del() {
this.$confirm({
title: "确认删除吗?",
okText: "是",
cancelText: "否",
icon: "exclamation-circle",
})
.then(() => {
this.$api.delGood({ id: 39 }).then((res) => {
this.$message({ message: "删除成功", type: "info" });
});
})
.catch(() => {
this.$message({ message: "取消删除", type: "error" });
});
},
$confirm:弹框,带确认和取消的按钮
- .then:点确认按钮后的处理
- .catch:点取消按钮后的处理
$message:显示消息