Uncaught (in promise) cancel Promise.then (async)

vue element項目中,提示框點擊取消報錯:Uncaught (in promise) cancel Promise.then (async)

解決方案: 加.catch(() => {})

this.$confirm(this.$t('message.delete'), this.$t('message.warning'), {
        confirmButtonText: this.$t('message.confirm'),
        cancelButtonText: this.$t('message.cancel'),
        type: 'warning',
        center: true
      }).then(() => {
        deleteRole(id).then(() => {
          this.$message({
            type: 'success',
            message: 'Success!'
          })
        })
        this.getRoleList()
      }).catch(() => {})

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章