看视频中在mounted中使用dispatch调用actions里fetchOrderList
在computed调用store里的getters中getOrderList方法
那么我在created中使用
self.$nextTick(()=>{
_calculateHeight() {
let foodList=this.$els.foodsWrapper.getElementsByClassName("food-list-hook");
let height=0;
this.listHeight.push(height);
for(let i=0; i<foodList.length;i++){
let item=foodList[i];
height+=item.clientHeight;
this.listHeight.push(height);
}
}
});
请问在以上状态中怎么使用nextTick.老师能否写个例子给我。这问题困扰我好久了。谢 谢