Dialog的使用,注意加上
context:this,
import Dialog from '../../vant-weapp/dialog/dialog';
//要是在Component({})子页面上用的话,要放到对应的a.json上引入, 而app.json不行的
"usingComponents": {
"van-dialog": "/vant-weapp/dialog/index",
}
Dialog.confirm({
context: this, //注意加上
title: '此商品已绑定其他分组',
message: '继续操作会解除与原分组的关联并将商品添加到到当前分组',
confirmButtonText: '继续'
}).then(() => {
this.data.list[one].isGoodSelected = !this.data.list[one].isGoodSelected;
this.setData({
list: this.data.list
})
this.recalGoodsStatus()
}).catch(() => {
// on cancel
});
--by Affandi ⊙▽⊙
网友评论