fix(tinymce): fixed inline mode

修复Tinymce的inline模式在一些场景下会出现异常的问题

fixed: #1092
This commit is contained in:
无木 2021-08-18 22:55:36 +08:00
parent e7c96363a1
commit 8e01377481
2 changed files with 14 additions and 3 deletions

View File

@ -5,6 +5,7 @@
### 🐛 Bug Fixes
- **CodeEditor** 修复 JSON 编辑器在格式化无效 JSON 文本时会抛出异常的问题
- **Tinymce** 修复 inline 模式在一些场景下会出现异常的问题
- **其它**
- 修复部分封装组件在使用插槽时报错的问题
- 修复`useECharts`的`theme`参数不起作用的问题

View File

@ -8,7 +8,13 @@
v-show="editorRef"
:disabled="disabled"
/>
<textarea :id="tinymceId" ref="elRef" :style="{ visibility: 'hidden' }"></textarea>
<textarea
:id="tinymceId"
ref="elRef"
:style="{ visibility: 'hidden' }"
v-if="!initOptions.inline"
></textarea>
<slot v-else></slot>
</div>
</template>
@ -188,7 +194,11 @@
);
onMountedOrActivated(() => {
if (initOptions.value.inline) {
tinymceId.value = unref(initOptions).selector!;
} else {
tinymceId.value = buildShortUUID('tiny-vue');
}
nextTick(() => {
setTimeout(() => {
initEditor();
@ -206,7 +216,7 @@
function destory() {
if (tinymce !== null) {
tinymce?.remove?.(unref(editorRef));
tinymce?.remove?.(tinymceId.value as string);
}
}