滑動betterScroll
數據更新後執行
mounted() {
this.$store.dispatch('getShopGoods', () => {// 數據更新後執行
this.$nextTick(() => { // 列表數據更新顯示後執行
this._initScroll()
this._initTops()
})
})
},
//actions/vux
// 異步獲取商家商品列表
async getShopGoods({commit}, callback) {
const result = await reqShopGoods()
if (result.code === 0) {
const goods = result.data
commit(RECEIVE_GOODS, {goods})
// 數據更新了, 通知一下組件
callback && callback()
}
},