美文网首页
Dialog的使用undefined

Dialog的使用undefined

作者: 浪浪山小妖_ | 来源:发表于2019-11-08 09:40 被阅读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 ⊙▽⊙

相关文章

网友评论

      本文标题:Dialog的使用undefined

      本文链接:https://www.haomeiwen.com/subject/dmbrbctx.html