diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 6a6f23c83db304b16ca3ff605e3dc3a0809c51fe..746ef5da679ed3bfdbbe3b00d6af54d874817dd9 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -1,3 +1,9 @@ +## Wip + +### 🐛 Bug Fixes + +- 修复多个富文本编辑器只显示一个 + ## 2.0.0-rc.9 (2020-11-9) ### ✨ Features diff --git a/build/vite/plugin/dynamicImport/index.ts b/build/vite/plugin/dynamicImport/index.ts index c8b2e5eea23eb1cf27baa09ef43263c365a52bea..6be898291bf4d4307558f3824f3ceea3166e3d22 100644 --- a/build/vite/plugin/dynamicImport/index.ts +++ b/build/vite/plugin/dynamicImport/index.ts @@ -34,7 +34,6 @@ const dynamicImportTransform = function (env: any = {}): Transform { export default function (id) { switch (id) { ${files - .map((p) => ` case '${getPath(p)}': return () => import('${p .replace('src/views', '/@/views') diff --git a/src/components/Tinymce/src/Editor.vue b/src/components/Tinymce/src/Editor.vue index ae74d4650fffaca62e6c9b63abd5c5ad741f8e5d..b33fb223a4e13f47fc3e573f7aa5c16c9039bba1 100644 --- a/src/components/Tinymce/src/Editor.vue +++ b/src/components/Tinymce/src/Editor.vue @@ -1,6 +1,6 @@ @@ -15,7 +15,6 @@ watch, onUnmounted, onDeactivated, - watchEffect, } from 'vue'; import { basicProps } from './props'; import toolbar from './toolbar'; @@ -36,12 +35,9 @@ emits: ['change', 'update:modelValue'], setup(props, { emit, attrs }) { const editorRef = ref(null); + const tinymceId = ref(snowUuid('tiny-vue')); const elRef = ref>(null); - const tinymceId = computed(() => { - return snowUuid('tiny-vue'); - }); - const tinymceContent = computed(() => { return props.modelValue; }); @@ -118,12 +114,18 @@ function init() { toPromise().then(() => { - initEditor(); + setTimeout(() => { + initEditor(); + }, 0); }); } function initEditor() { getTinymce().PluginManager.add('lineHeight', lineHeight(getTinymce())); + const el = unref(elRef); + if (el) { + el.style.visibility = ''; + } getTinymce().init(unref(initOptions)); }