getCategoryList () {
return new Promise((resolve, reject) => {
let code = {
code: this.marketId,
}
API.getCategoryNew(code).then(res => {
this.varietyList = res.data
resolve()
})
})
},
调用
async created () {
await this.getCategoryList()
this.getLabelList()
if (this.pageType === 'edit') {
// 编辑调用查询
this.init()
}
},
这样可以保证先执行getCategoryList这个函数

3283

被折叠的 条评论
为什么被折叠?



