this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
distinguishCancelAndClose: true, // 这个是关键
type: 'warning',
callback: action => { // 分别写回调
// console.log(action);
if (action === 'confirm'){
this.$message({
type: 'success',
message: '删除成功!'
});
}else if (action === 'cancel'){
this.$message({
type: 'info',
message: '取消删除'
});
}if (action === 'close'){
this.$message({
type: 'info',
message: '仅关闭确认框!'
});
}
}
});