nankai-cms-website-gov/plugins/messagebox.js

25 lines
658 B
JavaScript
Raw Normal View History

2025-03-13 09:52:18 +08:00
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
})
}
}
})