码迷,mamicode.com
首页 > 其他好文 > 详细

mint-ui里面的MessageBox怎么去判断确认还是取消

时间:2018-12-18 15:56:45      阅读:744      评论:0      收藏:0      [点我收藏+]

标签:log   返回   inf   ati   tle   ref   图片   ==   elb   

技术分享图片

   MessageBox.confirm('', {
          title: '请注意',
          message: '添加供应商前,请先搜索该供应商是否存在,请勿重复添加',
          showCancelButton: true,
          confirmButtonText: '去搜索',
          cancelButtonText: '新增'
        }).then((res) => {
          console.log(res)
          if (res === 'confirm') {
            this.$nextTick(() => {
              this.$refs.gain.focus()
            })
          }
        }).catch(() => {
          navigation('/supplier/editSuppplierInfo')
        })

这里的catch很重要,在then里面去判断确认.catch里面就是返回取消的了

mint-ui里面的MessageBox怎么去判断确认还是取消

标签:log   返回   inf   ati   tle   ref   图片   ==   elb   

原文地址:https://www.cnblogs.com/antyhouse/p/10137027.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!