this.$confirm("存在未保存模板,是否切換模板!", "提示", {
confirmButtonText: "確定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$message({
type: "success",
message: "刪除成功!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消操作",
});
});
方法一直進入catch中,這個問題主要是因為.then方法里代碼出錯導致的,我的問題是里面的接口請求出了問題導致的。
