Commit d73d43ed91f30957cfd202c51552ca40a19cef08
1 parent
8a3f47d6
fix(table): make sure the table width is correct, fix #593
Showing
3 changed files
with
14 additions
and
9 deletions
src/components/Table/src/BasicTable.vue
src/components/Tinymce/src/Editor.vue
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | </template> |
13 | 13 | |
14 | 14 | <script lang="ts"> |
15 | + import type { RawEditorSettings } from 'tinymce'; | |
15 | 16 | import tinymce from 'tinymce/tinymce'; |
16 | 17 | import 'tinymce/themes/silver'; |
17 | 18 | |
... | ... | @@ -71,7 +72,7 @@ |
71 | 72 | |
72 | 73 | const tinymceProps = { |
73 | 74 | options: { |
74 | - type: Object as PropType<any>, | |
75 | + type: Object as PropType<Partial<RawEditorSettings>>, | |
75 | 76 | default: {}, |
76 | 77 | }, |
77 | 78 | value: { |
... | ... | @@ -141,7 +142,7 @@ |
141 | 142 | return ['zh_CN', 'en'].includes(lang) ? lang : 'zh_CN'; |
142 | 143 | }); |
143 | 144 | |
144 | - const initOptions = computed(() => { | |
145 | + const initOptions = computed((): RawEditorSettings => { | |
145 | 146 | const { height, options, toolbar, plugins } = props; |
146 | 147 | const publicPath = import.meta.env.VITE_PUBLIC_PATH || '/'; |
147 | 148 | return { |
... | ... | @@ -156,14 +157,15 @@ |
156 | 157 | default_link_target: '_blank', |
157 | 158 | link_title: false, |
158 | 159 | object_resizing: false, |
160 | + auto_focus: true, | |
159 | 161 | skin: skinName.value, |
160 | 162 | skin_url: publicPath + 'resource/tinymce/skins/ui/' + skinName.value, |
161 | 163 | content_css: |
162 | 164 | publicPath + 'resource/tinymce/skins/ui/' + skinName.value + '/content.min.css', |
163 | 165 | ...options, |
164 | - setup: (editor: any) => { | |
166 | + setup: (editor) => { | |
165 | 167 | editorRef.value = editor; |
166 | - editor.on('init', (e: Event) => initSetup(e)); | |
168 | + editor.on('init', (e) => initSetup(e)); | |
167 | 169 | }, |
168 | 170 | }; |
169 | 171 | }); |
... | ... | @@ -210,7 +212,7 @@ |
210 | 212 | tinymce.init(unref(initOptions)); |
211 | 213 | } |
212 | 214 | |
213 | - function initSetup(e: Event) { | |
215 | + function initSetup(e) { | |
214 | 216 | const editor = unref(editorRef); |
215 | 217 | if (!editor) { |
216 | 218 | return; | ... | ... |
src/main.ts
1 | 1 | import '/@/design/index.less'; |
2 | + | |
3 | +// Register windi | |
2 | 4 | import 'virtual:windi.css'; |
5 | +// Register icon sprite | |
6 | +import 'virtual:svg-icons-register'; | |
3 | 7 | |
4 | 8 | import { createApp } from 'vue'; |
5 | 9 | import App from './App.vue'; |
6 | 10 | import { initAppConfigStore } from '/@/logics/initAppConfig'; |
11 | +import { setupErrorHandle } from '/@/logics/error-handle'; | |
7 | 12 | import router, { setupRouter } from '/@/router'; |
8 | 13 | import { setupRouterGuard } from '/@/router/guard'; |
9 | 14 | import { setupStore } from '/@/store'; |
10 | -import { setupErrorHandle } from '/@/logics/error-handle'; | |
11 | 15 | import { setupGlobDirectives } from '/@/directives'; |
12 | 16 | import { setupI18n } from '/@/locales/setupI18n'; |
13 | 17 | import { registerGlobComp } from '/@/components/registerGlobComp'; |
14 | 18 | |
15 | -// Register icon Sprite | |
16 | -import 'virtual:svg-icons-register'; | |
17 | - | |
18 | 19 | // Do not introduce on-demand in local development? |
19 | 20 | // In the local development for introduce on-demand, the number of browser requests will increase by about 20%. |
20 | 21 | // Which may slow down the browser refresh. | ... | ... |