File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed
build/vite/plugin/dynamicImport
src/components/Tinymce/src Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1+ ## Wip
2+
3+ ### 🐛 Bug Fixes
4+
5+ - 修复多个富文本编辑器只显示一个
6+
17## 2.0.0-rc.9 (2020-11-9)
28
39### ✨ Features
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ const dynamicImportTransform = function (env: any = {}): Transform {
3434 export default function (id) {
3535 switch (id) {
3636 ${ files
37-
3837 . map ( ( p ) =>
3938 ` case '${ getPath ( p ) } ': return () => import('${ p
4039 . replace ( 'src/views' , '/@/views' )
Original file line number Diff line number Diff line change 11<template >
22 <div class =" tinymce-container" :style =" { width: containerWidth }" >
3- <textarea :id =" tinymceId" ref =" elRef" ></textarea >
3+ <textarea :id =" tinymceId" ref =" elRef" :style = " { visibility: 'hidden' } " ></textarea >
44 </div >
55</template >
66
1515 watch ,
1616 onUnmounted ,
1717 onDeactivated ,
18- watchEffect ,
1918 } from ' vue' ;
2019 import { basicProps } from ' ./props' ;
2120 import toolbar from ' ./toolbar' ;
3635 emits: [' change' , ' update:modelValue' ],
3736 setup(props , { emit , attrs }) {
3837 const editorRef = ref <any >(null );
38+ const tinymceId = ref <string >(snowUuid (' tiny-vue' ));
3939 const elRef = ref <Nullable <HTMLElement >>(null );
4040
41- const tinymceId = computed (() => {
42- return snowUuid (' tiny-vue' );
43- });
44-
4541 const tinymceContent = computed (() => {
4642 return props .modelValue ;
4743 });
118114
119115 function init() {
120116 toPromise ().then (() => {
121- initEditor ();
117+ setTimeout (() => {
118+ initEditor ();
119+ }, 0 );
122120 });
123121 }
124122
125123 function initEditor() {
126124 getTinymce ().PluginManager .add (' lineHeight' , lineHeight (getTinymce ()));
125+ const el = unref (elRef );
126+ if (el ) {
127+ el .style .visibility = ' ' ;
128+ }
127129 getTinymce ().init (unref (initOptions ));
128130 }
129131
You can’t perform that action at this time.
0 commit comments