Commit d73d43ed91f30957cfd202c51552ca40a19cef08

Authored by vben
1 parent 8a3f47d6

fix(table): make sure the table width is correct, fix #593

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