wangEditor 放在el-dialog里面再次显示报错。

b1zrtrql  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(40)

我知道为什么会出错。

let Editor:any = null
let Toolbar:any = null
const model=defineModel<string>()
const toolbarConfig = {}
const isLoading = ref(false)
const editorRef = shallowRef()
const handleCreated = (editor:any) => {
    editorRef.value = editor
    console.log('editor created:', editor)
}
onBeforeUnmount(() => {
    const editor = editorRef.value
    if (editor == null) return
    editor.destroy()
})
if(process.client){
    // @ts-ignore
    let editor=await import('@wangeditor/editor-for-vue')
    Editor = editor.Editor
    Toolbar = editor.Toolbar
}

sgtfey8w

sgtfey8w1#

看着不是 wangEditor 的问题,再看看创建和销毁的流程有没有问题?

相关问题