mint-ui
mint-ui copied to clipboard
message-box点取消时会报错
message-box点取消时会报如下错: Uncaught (in promise) cancel 官方的demo也是如此。
这不是报错,只是被 reject 的 Promise 没有 catch。好像只有 Chrome 会这样。
加上catch 什么也不做就可以了:
this.$confirm('确认关闭?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// Do something
}).catch(() => {})