From 602428acebf5fe6d30e87dd1c68e72a0d14c045b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Thu, 10 Oct 2024 11:51:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quill-editor-preview/quill-editor-preview.tsx | 11 +++-------- src/editor/html/quill-editor/quill-editor.tsx | 10 +++++----- src/mob-app/App.tsx | 1 - 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/editor/html/quill-editor-preview/quill-editor-preview.tsx b/src/editor/html/quill-editor-preview/quill-editor-preview.tsx index b2f2ea4bfa..18c781d6e3 100644 --- a/src/editor/html/quill-editor-preview/quill-editor-preview.tsx +++ b/src/editor/html/quill-editor-preview/quill-editor-preview.tsx @@ -1,10 +1,6 @@ /* eslint-disable import/no-extraneous-dependencies */ import { defineComponent, onMounted, ref } from 'vue'; -import { - getHtmlProps, - getEditorEmits, - useNamespace, -} from '@ibiz-template/vue3-util'; +import { getHtmlProps, useNamespace } from '@ibiz-template/vue3-util'; import Quill from 'quill'; import { HtmlEditorController } from '../html-editor.controller'; import './quill-editor-preview.scss'; @@ -13,7 +9,6 @@ import './quill-editor-preview.scss'; const IBizQuillPreview: any = defineComponent({ name: 'IBizQuillPreview', props: getHtmlProps(), - emits: getEditorEmits(), setup(props, { emit }) { const ns = useNamespace('quill-preview'); const c: HtmlEditorController = props.controller; @@ -35,7 +30,7 @@ const IBizQuillPreview: any = defineComponent({ readOnly: true, }); if (c.valueMode === 'text') { - quill.setText(props.value); + quill.setText(props.value || ''); } }; @@ -69,7 +64,7 @@ const IBizQuillPreview: any = defineComponent({
) : null} - {!this.readOnly && !this.disable ? ( + {!this.readonly && !this.disabled ? (
diff --git a/src/editor/html/quill-editor/quill-editor.tsx b/src/editor/html/quill-editor/quill-editor.tsx index b22f9ba72a..9dbd6108fa 100644 --- a/src/editor/html/quill-editor/quill-editor.tsx +++ b/src/editor/html/quill-editor/quill-editor.tsx @@ -100,12 +100,12 @@ const IBizQuill: any = defineComponent({ } }); if (c.valueMode === 'text') { - quill.setText(props.value); + quill.setText(props.value || ''); } }; watch( - () => [props.disable, props.readonly], + () => [props.disabled, props.readonly], () => { if (!quill) { return; @@ -140,7 +140,7 @@ const IBizQuill: any = defineComponent({ watch( () => props.value, () => { - if (!quill) { + if (!quill || !props.value) { return; } tempValue.value = props.value; @@ -199,8 +199,8 @@ const IBizQuill: any = defineComponent({ { this.editing = true; }} diff --git a/src/mob-app/App.tsx b/src/mob-app/App.tsx index f0c29e278c..4da0d8a0a7 100644 --- a/src/mob-app/App.tsx +++ b/src/mob-app/App.tsx @@ -19,7 +19,6 @@ export default defineComponent({ document.removeEventListener('keydown', listenDevtool); const devtoolConfig = ibiz.env.devtoolConfig || {}; - devtoolConfig.platform = 'mob'; ibiz.env.devtoolConfig = devtoolConfig; // 加载模块 const module = await import('@ibiz-template/devtool'); -- Gitee