From 69af37ec88e21acf926fdf5969c2189dc7450822 Mon Sep 17 00:00:00 2001 From: vben Date: Tue, 3 Nov 2020 00:59:39 +0800 Subject: [PATCH] fix(table): fix table typo --- CHANGELOG.zh_CN.md | 6 ++++++ src/components/Table/src/types/table.ts | 16 ++++++++++------ src/views/demo/table/tableData.tsx | 12 ++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index f5cb0c39..8f4d56e6 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -7,6 +7,12 @@ ### 🎫 Chores - 删除菜单背景图 +- 更新`ant-design-vue`版本为`beta13` +- 更新`vite`版本为`rc.9` + +### 🐛 Bug Fixes + +- 修复升级之后 table 类型问题 ## 2.0.0-rc.8 (2020-11-2) diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts index 69bd80e7..7f0814b0 100644 --- a/src/components/Table/src/types/table.ts +++ b/src/components/Table/src/types/table.ts @@ -1,9 +1,12 @@ import type { VNodeChild } from 'vue'; import type { PaginationProps } from './pagination'; import type { FormProps } from '/@/components/Form/index'; -import type { IColumnProps, ITableRowSelection } from 'ant-design-vue/lib/table/interface'; +import type { + ColumnProps, + TableRowSelection as ITableRowSelection, +} from 'ant-design-vue/lib/table/interface'; import { ComponentType } from './componentType'; -import { ColumnProps } from './column'; +// import { ColumnProps } from './column'; export declare type SortOrder = 'ascend' | 'descend'; export interface TableCurrentDataSource { currentDataSource: T[]; @@ -55,8 +58,8 @@ export interface TableCustomRecord { index?: number; } -export interface SorterResult { - column: ColumnProps; +export interface SorterResult { + column: ColumnProps; order: SortOrder; field: string; columnKey: string; @@ -309,7 +312,7 @@ export interface BasicTableProps { * Set props on per header row * @type Function */ - customHeaderRow?: (column: IColumnProps, index: number) => object; + customHeaderRow?: (column: ColumnProps, index: number) => object; /** * Set props on per row @@ -366,8 +369,9 @@ export interface BasicTableProps { onExpandedRowsChange?: (expandedRows: string[] | number[]) => void; } -export interface BasicColumn extends IColumnProps { +export interface BasicColumn extends ColumnProps { children?: BasicColumn[]; + // flag?: 'INDEX' | 'DEFAULT' | 'CHECKBOX' | 'RADIO' | 'ACTION'; diff --git a/src/views/demo/table/tableData.tsx b/src/views/demo/table/tableData.tsx index 5e8ceeee..7f77298e 100644 --- a/src/views/demo/table/tableData.tsx +++ b/src/views/demo/table/tableData.tsx @@ -80,8 +80,8 @@ export function getMultipleHeaderColumns(): BasicColumn[] { dataIndex: 'no', width: 120, filters: [ - { text: 'Male', value: 'male' }, - { text: 'Female', value: 'female' }, + { text: 'Male', value: 'male', children: [] }, + { text: 'Female', value: 'female', children: [] }, ], }, @@ -125,8 +125,8 @@ export function getCustomHeaderColumns(): BasicColumn[] { dataIndex: 'no', width: 120, filters: [ - { text: 'Male', value: 'male' }, - { text: 'Female', value: 'female' }, + { text: 'Male', value: 'male', children: [] }, + { text: 'Female', value: 'female', children: [] }, ], }, { @@ -190,8 +190,8 @@ export function getMergeHeaderColumns(): BasicColumn[] { dataIndex: 'no', colSpan: 0, filters: [ - { text: 'Male', value: 'male' }, - { text: 'Female', value: 'female' }, + { text: 'Male', value: 'male', children: [] }, + { text: 'Female', value: 'female', children: [] }, ], customRender: renderContent, }, -- GitLab