sohelp-ele
Version:
SohelpEle Library
27 lines (26 loc) • 579 B
JavaScript
import { Loading, Message } from "element-ui";
function messageLoading(options) {
if (typeof options === "string") {
options = { message: options };
}
const loading = Loading.service({
spinner: "none",
background: options.background || "transparent"
});
return Message(
Object.assign(
{
duration: 0,
customClass: "ele-message-loading"
},
options,
{
onClose: (ins) => {
loading.close();
options.onClose && options.onClose(ins);
}
}
)
);
}
export { messageLoading };