javascript
复制代码
let customClass = 'zsl-el-message-box'
efb.messageBox({
title: '操作提示',
showConfirmButton: false,
customClass,
message: efb.VNode('div', null, [
efb.VNode('style', null, `.${customClass} .el-message-box__message {width: 100%;}`),
efb.VNode('div', null, 'hello world'),
efb.VNode('div', {
class: 'el-message-box__btns',
}, [
efb.VNode('button', {
class: 'el-button el-button--primary',
onClick(event) {
event.target.closest('.el-message-box').querySelector('.el-message-box__btns button[aria-disabled=false]').click();
console.log('确认', event)
}
}, '确定'),
efb.VNode('button', {
class: 'el-button el-button--success',
onClick(event) {
event.target.closest('.el-message-box').querySelector('.el-message-box__btns button[aria-disabled=false]').click();
console.log('按钮2', event)
}
}, '按钮2'),
efb.VNode('button', {
class: 'el-button',
onClick() {
event.target.closest('.el-message-box').querySelector('.el-message-box__close').click();
console.log('取消', event)
}
}, '取消')
])
]),
}).then( (result) => {
console.log(result, 'then')
}
).catch( () => {})