From 8faa5105b852fcb1ac42906e4d6a592b231ad65b Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 24 Jun 2024 14:36:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/plugin/src/index.vue | 4 ++++ .../custom-component/rich-text/DeRichTextView.vue | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/components/plugin/src/index.vue b/core/core-frontend/src/components/plugin/src/index.vue index 147e71cbd5..fdb7328aa0 100644 --- a/core/core-frontend/src/components/plugin/src/index.vue +++ b/core/core-frontend/src/components/plugin/src/index.vue @@ -9,6 +9,7 @@ import * as Vue from 'vue' import axios from 'axios' import * as Pinia from 'pinia' import * as vueRouter from 'vue-router' +import tinymce from 'tinymce/tinymce' import { useEmitt } from '@/hooks/web/useEmitt' const { wsCache } = useCache() @@ -109,6 +110,9 @@ onMounted(async () => { window['vueRouter'] = vueRouter window['MittAll'] = useEmitt().emitter.all window['I18n'] = i18n + if (!window.tinymce) { + window.tinymce = tinymce + } loadDistributed().then(async res => { new Function(res.data)() const xpack = await window['DEXPack'].mapping[attrs.jsname] diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index c1ccdf7c0e..57a8000aac 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -153,7 +153,7 @@ watch( () => active.value, val => { if (!val) { - const ed = window.tinymce.editors[tinymceId] + const ed = tinymce.editors[tinymceId] if (canEdit.value) { element.value.propValue.textValue = ed.getContent() } @@ -170,7 +170,7 @@ watch( () => myValue.value, () => { if (canEdit.value) { - const ed = window.tinymce.editors[tinymceId] + const ed = tinymce.editors[tinymceId] element.value.propValue.textValue = ed.getContent() } if (initReady.value && canEdit.value) { @@ -245,7 +245,7 @@ const assignment = content => { return content } const fieldSelect = field => { - const ed = window.tinymce.editors[tinymceId] + const ed = tinymce.editors[tinymceId] const fieldId = 'changeText-' + guid() const value = '