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

fix(tinymce): fixed `inline` mode

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

fixed: #1092
上级 e7c96363
......@@ -5,6 +5,7 @@
### 🐛 Bug Fixes
- **CodeEditor** 修复 JSON 编辑器在格式化无效 JSON 文本时会抛出异常的问题
- **Tinymce** 修复 inline 模式在一些场景下会出现异常的问题
- **其它**
- 修复部分封装组件在使用插槽时报错的问题
- 修复`useECharts``theme`参数不起作用的问题
......
......@@ -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(() => {
tinymceId.value = buildShortUUID('tiny-vue');
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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册