25 lines
658 B
JavaScript
25 lines
658 B
JavaScript
import { ElMessageBox } from 'element-plus'
|
|
export default defineNuxtPlugin(nuxtApp => {
|
|
nuxtApp.vueApp.config.globalProperties.$dialog = {
|
|
...ElMessageBox,
|
|
/**
|
|
* 重要提醒
|
|
*
|
|
* @param message 消息内容
|
|
* @param title 提醒标题
|
|
* @param extConfig 扩展配置
|
|
* @returns {Promise}
|
|
*/
|
|
attentionConfirm (message, title = '重要提醒', extConfig = {}) {
|
|
return ElMessageBox.confirm(message, title, {
|
|
showCancelButton: false,
|
|
showClose: false,
|
|
closeOnClickModal: false,
|
|
closeOnPressEscape: false,
|
|
type: 'warning',
|
|
...extConfig
|
|
})
|
|
}
|
|
}
|
|
})
|