Skip to content

Commit

Permalink
fix(tinymce): fixed inline mode
Browse files Browse the repository at this point in the history
修复Tinymce的inline模式在一些场景下会出现异常的问题

fixed: #1092
  • Loading branch information
mynetfan committed Aug 18, 2021
1 parent e7c9636 commit 8e01377
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### 🐛 Bug Fixes

- **CodeEditor** 修复 JSON 编辑器在格式化无效 JSON 文本时会抛出异常的问题
- **Tinymce** 修复 inline 模式在一些场景下会出现异常的问题
- **其它**
- 修复部分封装组件在使用插槽时报错的问题
- 修复`useECharts``theme`参数不起作用的问题
Expand Down
16 changes: 13 additions & 3 deletions src/components/Tinymce/src/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -188,7 +194,11 @@
);
onMountedOrActivated(() => {
tinymceId.value = buildShortUUID('tiny-vue');
if (initOptions.value.inline) {
tinymceId.value = unref(initOptions).selector!;
} else {
tinymceId.value = buildShortUUID('tiny-vue');
}
nextTick(() => {
setTimeout(() => {
initEditor();
Expand All @@ -206,7 +216,7 @@
function destory() {
if (tinymce !== null) {
tinymce?.remove?.(unref(editorRef));
tinymce?.remove?.(tinymceId.value as string);
}
}
Expand Down

0 comments on commit 8e01377

Please sign in to comment.