messageBox global function in elementui is defined in vue
//
export let messageBox = (vm) => {
const h = vm.$createElement;
vm.$msgbox(
{
title: " ",
message: h("p", null, [
h("span", {"class": "queMark"}, "?"),
h("p", {"class": "text1"}, ""),
h("p", {"class": "text2"}, "")
]),
confirmButtonText: "",
beforeClose: (action, instance, done) => {
if (action === "confirm") {
done();
} else {
done();
}
}
});
};
call
in the component//
handleDelete: function () {
let flag = messageBox(this);
console.log(flag)
},
but how can you get the value that you click to confirm or cancel? The output is always undefined;, not even with return, ask for expert advice