npm i quick-el-dialog
import Vue from 'vue'
import UseDynamicMount from 'use-dynamic-mount'
import QuickElDialog from 'quick-el-dialog'
app.use(UseDynamicMount(), {
name: '$createDialog',
extend: QuickElDialog,
nextTick() {
// 勿使用箭头函数
this.visible = true
}
})
this.$createDialog({
title: '标题',
component: 'el-empty',
props: { description: '测试内容' },
buttons: [{ text: '关闭', callback: 'close', cib: true }]
})