Skip to content

Commit f078c86

Browse files
committed
fix #2
1 parent 708fdbc commit f078c86

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

antd-pro/src/app.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { errorConfig } from './requestErrorConfig';
99
import React from 'react';
1010
import { AvatarDropdown, AvatarName } from './components/RightContent/AvatarDropdown';
1111
import { loadLayoutMenus, loadLoayoutMenuAuthentications } from './components/Menu';
12-
import { flushSync } from 'react-dom';
1312
import { menus } from '@/services/api/account'
1413
const loginPath = '/user/login';
1514

components-ui/src/components/MyTable/MyTable.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ export const MyTable = forwardRef(<T extends Record<string, any>, U extends Para
4343

4444
const [isSort, setIsSort] = useState<boolean>(false);
4545

46-
const [columns, setColumns] = useState<any>(props.columns);
46+
const propsColumns = props.columns.map(item => {
47+
if (item.width === undefined) {
48+
item.width = 100;
49+
}
50+
return item;
51+
});
52+
53+
const [columns, setColumns] = useState<any>(propsColumns);
4754

4855
const handleResize = (index: number) => (e: any, { size }: any) => {
4956
const nextColumns = [...(columns ?? [])];

0 commit comments

Comments
 (0)