this.$confirm('请选择处理方式', '提示', {
distinguishCancelAndClose: true, //区分取消和关闭
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info'
}).then(() => {
this.$message({
type: 'info',
message: '点击确定执行的代码'
});
}).catch(action => {
this.$message({
type: 'info',
message: action === 'cancel'
? '点击取消执行的代码'
: '点击关闭执行的代码'
});
});
Vue中this.$confirm确定和取消执行不同的逻辑
最新推荐文章于 2024-07-25 17:11:44 发布