-
@author 封装 element-ui 弹框
-
@param text 文本内容 (不传默认显示 确定执行此操作吗? )
-
@param type 弹框类型(不传默认warning类型)
-
@param title 弹框标题(不传默认显示 提示 )
export function utilConfirm(text = '确定执行此操作吗?', type = 'warning', title = '提示') {
return new Promise(resolve => {
MessageBox.confirm(text, title, {confirmButtonText: '确定',cancelButtonText: '取消',type: type
}).then(res => {resolve(res === 'confirm')}).catch(_ => false)
})
}