export function confirmANewline (h, value) {
const newDatas = [];
const confirmText = [...value];
for (const i in confirmText) {
newDatas.push(h("p", null, confirmText[i]));
}
const promiseconfirm = new Promise((resolve, reject) => {
MessageBox.confirm('Tip', {
title: "Tip",
message: h("div", null, newDatas),
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "保存",
type: "",
}).then(() => {
resolve(true)
}).catch(() => {
resolve(false)
})
})
return promiseconfirm
}
使用
async saveSubmitfun(item) {
const h = this.$createElement;
let abc = 11
let confirmText1 = [
`一共有${abc}`,
`Notes:一共有${abc}`,
];
let a = await confirmANewline(h, confirmText1);}