提交 8e013774 编写于 作者: 无木

fix(tinymce): fixed `inline` mode

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

fixed: #1092
上级 e7c96363
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
### 🐛 Bug Fixes ### 🐛 Bug Fixes
- **CodeEditor** 修复 JSON 编辑器在格式化无效 JSON 文本时会抛出异常的问题 - **CodeEditor** 修复 JSON 编辑器在格式化无效 JSON 文本时会抛出异常的问题
- **Tinymce** 修复 inline 模式在一些场景下会出现异常的问题
- **其它** - **其它**
- 修复部分封装组件在使用插槽时报错的问题 - 修复部分封装组件在使用插槽时报错的问题
- 修复`useECharts``theme`参数不起作用的问题 - 修复`useECharts``theme`参数不起作用的问题
......
...@@ -8,7 +8,13 @@ ...@@ -8,7 +8,13 @@
v-show="editorRef" v-show="editorRef"
:disabled="disabled" :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> </div>
</template> </template>
...@@ -188,7 +194,11 @@ ...@@ -188,7 +194,11 @@
); );
onMountedOrActivated(() => { onMountedOrActivated(() => {
tinymceId.value = buildShortUUID('tiny-vue'); if (initOptions.value.inline) {
tinymceId.value = unref(initOptions).selector!;
} else {
tinymceId.value = buildShortUUID('tiny-vue');
}
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
initEditor(); initEditor();
...@@ -206,7 +216,7 @@ ...@@ -206,7 +216,7 @@
function destory() { function destory() {
if (tinymce !== null) { if (tinymce !== null) {
tinymce?.remove?.(unref(editorRef)); tinymce?.remove?.(tinymceId.value as string);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册