fix: fix the error reported by the Editor component

This commit is contained in:
陈凯龙 2022-04-14 09:01:06 +08:00
parent 90ef9856a0
commit 7dc6d8a9d7
1 changed files with 3 additions and 3 deletions

View File

@ -78,10 +78,10 @@ const handleChange = (editor: IDomEditor) => {
//
onBeforeUnmount(() => {
const editor = unref(editorRef.value)
if (editor == null) return
if (editor === null) return
// editor
editor.destroy()
editor?.destroy()
})
const getEditorRef = async (): Promise<IDomEditor> => {
@ -110,12 +110,12 @@ watch(
<div v-if="show" class="border-1 border-solid border-[var(--tags-view-border-color)]">
<!-- 工具栏 -->
<Toolbar
:editor="editorRef"
:editorId="editorId"
class="border-bottom-1 border-solid border-[var(--tags-view-border-color)]"
/>
<!-- 编辑器 -->
<Editor
:editor="editorRef"
:editorId="editorId"
:defaultConfig="editorConfig"
:defaultHtml="defaultHtml"