vue3 elementUI封装
·
ctxt.del(8, ctxt.getApi().unit.unit.del)
const del = (id,delFn) => {
const p = () => {
delFn({id}).then(res => {
if (res.code === 0) {
console.log(res)
getMessage().success(res.msg);
} else {
console.error(res)
getMessage().error(res.msg);
}
})
}
const ok = confirm("你确定要删除吗?", p)
}
const confirm = async (prompt, process) => {
const isConfirm = await getMessageBox().confirm(prompt ? prompt : "确认提交此次编辑吗?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning",
})
if (isConfirm && process) {
process();
}
return isConfirm
}更多推荐

所有评论(0)