Commit 69af37ec88e21acf926fdf5969c2189dc7450822

Authored by vben
1 parent 86de3104

fix(table): fix table typo

CHANGELOG.zh_CN.md
@@ -7,6 +7,12 @@ @@ -7,6 +7,12 @@
7 ### 🎫 Chores 7 ### 🎫 Chores
8 8
9 - 删除菜单背景图 9 - 删除菜单背景图
  10 +- 更新`ant-design-vue`版本为`beta13`
  11 +- 更新`vite`版本为`rc.9`
  12 +
  13 +### 🐛 Bug Fixes
  14 +
  15 +- 修复升级之后 table 类型问题
10 16
11 ## 2.0.0-rc.8 (2020-11-2) 17 ## 2.0.0-rc.8 (2020-11-2)
12 18
src/components/Table/src/types/table.ts
1 import type { VNodeChild } from 'vue'; 1 import type { VNodeChild } from 'vue';
2 import type { PaginationProps } from './pagination'; 2 import type { PaginationProps } from './pagination';
3 import type { FormProps } from '/@/components/Form/index'; 3 import type { FormProps } from '/@/components/Form/index';
4 -import type { IColumnProps, ITableRowSelection } from 'ant-design-vue/lib/table/interface'; 4 +import type {
  5 + ColumnProps,
  6 + TableRowSelection as ITableRowSelection,
  7 +} from 'ant-design-vue/lib/table/interface';
5 import { ComponentType } from './componentType'; 8 import { ComponentType } from './componentType';
6 -import { ColumnProps } from './column'; 9 +// import { ColumnProps } from './column';
7 export declare type SortOrder = 'ascend' | 'descend'; 10 export declare type SortOrder = 'ascend' | 'descend';
8 export interface TableCurrentDataSource<T = any> { 11 export interface TableCurrentDataSource<T = any> {
9 currentDataSource: T[]; 12 currentDataSource: T[];
@@ -55,8 +58,8 @@ export interface TableCustomRecord&lt;T = any&gt; { @@ -55,8 +58,8 @@ export interface TableCustomRecord&lt;T = any&gt; {
55 index?: number; 58 index?: number;
56 } 59 }
57 60
58 -export interface SorterResult<T> {  
59 - column: ColumnProps<T>; 61 +export interface SorterResult {
  62 + column: ColumnProps;
60 order: SortOrder; 63 order: SortOrder;
61 field: string; 64 field: string;
62 columnKey: string; 65 columnKey: string;
@@ -309,7 +312,7 @@ export interface BasicTableProps&lt;T = any&gt; { @@ -309,7 +312,7 @@ export interface BasicTableProps&lt;T = any&gt; {
309 * Set props on per header row 312 * Set props on per header row
310 * @type Function 313 * @type Function
311 */ 314 */
312 - customHeaderRow?: (column: IColumnProps, index: number) => object; 315 + customHeaderRow?: (column: ColumnProps, index: number) => object;
313 316
314 /** 317 /**
315 * Set props on per row 318 * Set props on per row
@@ -366,8 +369,9 @@ export interface BasicTableProps&lt;T = any&gt; { @@ -366,8 +369,9 @@ export interface BasicTableProps&lt;T = any&gt; {
366 onExpandedRowsChange?: (expandedRows: string[] | number[]) => void; 369 onExpandedRowsChange?: (expandedRows: string[] | number[]) => void;
367 } 370 }
368 371
369 -export interface BasicColumn extends IColumnProps { 372 +export interface BasicColumn extends ColumnProps {
370 children?: BasicColumn[]; 373 children?: BasicColumn[];
  374 +
371 // 375 //
372 flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION'; 376 flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION';
373 377
src/views/demo/table/tableData.tsx
@@ -80,8 +80,8 @@ export function getMultipleHeaderColumns(): BasicColumn[] { @@ -80,8 +80,8 @@ export function getMultipleHeaderColumns(): BasicColumn[] {
80 dataIndex: 'no', 80 dataIndex: 'no',
81 width: 120, 81 width: 120,
82 filters: [ 82 filters: [
83 - { text: 'Male', value: 'male' },  
84 - { text: 'Female', value: 'female' }, 83 + { text: 'Male', value: 'male', children: [] },
  84 + { text: 'Female', value: 'female', children: [] },
85 ], 85 ],
86 }, 86 },
87 87
@@ -125,8 +125,8 @@ export function getCustomHeaderColumns(): BasicColumn[] { @@ -125,8 +125,8 @@ export function getCustomHeaderColumns(): BasicColumn[] {
125 dataIndex: 'no', 125 dataIndex: 'no',
126 width: 120, 126 width: 120,
127 filters: [ 127 filters: [
128 - { text: 'Male', value: 'male' },  
129 - { text: 'Female', value: 'female' }, 128 + { text: 'Male', value: 'male', children: [] },
  129 + { text: 'Female', value: 'female', children: [] },
130 ], 130 ],
131 }, 131 },
132 { 132 {
@@ -190,8 +190,8 @@ export function getMergeHeaderColumns(): BasicColumn[] { @@ -190,8 +190,8 @@ export function getMergeHeaderColumns(): BasicColumn[] {
190 dataIndex: 'no', 190 dataIndex: 'no',
191 colSpan: 0, 191 colSpan: 0,
192 filters: [ 192 filters: [
193 - { text: 'Male', value: 'male' },  
194 - { text: 'Female', value: 'female' }, 193 + { text: 'Male', value: 'male', children: [] },
  194 + { text: 'Female', value: 'female', children: [] },
195 ], 195 ],
196 customRender: renderContent, 196 customRender: renderContent,
197 }, 197 },