假如当删除用户时,有时需要弹出一些确定信息,一般有两种形式:消息提示、弹框。
第一种就是用$message信息框来提醒用户:
this.$message({
message: '确定删除该用户?',
type: 'warning'
})
第二种就是用$confirm确认框来操作:
this.$confirm('将删除该用户, 是否确定?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(111);
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});