wangEditor icon indicating copy to clipboard operation
wangEditor copied to clipboard

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

Open bbhxwl opened this issue 1 year ago • 2 comments

我知道为什么会出错。

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
}

image

bbhxwl avatar May 13 '24 02:05 bbhxwl

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

cycleccc avatar May 16 '24 09:05 cycleccc

我也遇到类似的二次弹窗报错,我的解决方案是 方法1、el-dialog 加:destroy-on-close="true" 或者 方法2、 <wangEditor v-if="updateDialog"/> 跟着弹窗隐藏销毁,那个编辑器自带的销毁没啥用还是要v-if比较靠谱

gonglb avatar Sep 23 '24 09:09 gonglb