Dialog的使用undefined

2019-11-08  本文已影响0人  浪浪山小妖_

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 ⊙▽⊙

上一篇 下一篇

猜你喜欢

热点阅读