mintUI MessageBox confirm弹框确认和取消按钮的使用-回调
注意:需要使用then和catch进行捕获
MessageBox.confirm("", {
message: "你确定删除吗?",
title: "警告"
}).then(action => {
if (action == "confirm") {
console.log(1);
this.$http.post(this.$apis.cartdelete, { id }).then(res => {
console.log(res, 11);
if (res.data.code == 200) {
this.goods.splice(idx,1);
Indicator.open("删除成功...");
setTimeout(() => {
Indicator.close();
}, 600);
}
});
}
})
.catch(err => {
if (err == "cancel") {
console.log(2);
}
});
本文来自博客园,作者:JackieDYH,转载请注明原文链接:https://www.cnblogs.com/JackieDYH/p/17634631.html