diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index c262aae399..d26cfca74b 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -191,28 +191,28 @@ Properties for row selection. import { Table } from 'antd'; import { ColumnProps } from 'antd/lib/table'; -interface IUser { +interface User { key: number, name: string; } -const columns: ColumnProps[] = [{ +const columns: ColumnProps[] = [{ key: 'name', title: 'Name', dataIndex: 'name', }]; -const data: IUser[] = [{ +const data: User[] = [{ key: 0, name: 'Jack', }]; -class UserTable extends Table {} +class UserTable extends Table {} // Use JSX style API -class NameColumn extends Table.Column {} +class NameColumn extends Table.Column {} @@ -220,9 +220,9 @@ class NameColumn extends Table.Column {} // after TypeScript 2.9 can write like this // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#generic-type-arguments-in-jsx-elements - columns={columns} dataSource={data} /> - dataSource={data}> - key="name" title="Name" dataIndex="name" /> + columns={columns} dataSource={data} /> + dataSource={data}> + key="name" title="Name" dataIndex="name" /> ``` diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index 63a91847a6..a9e4297c52 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -196,27 +196,27 @@ const columns = [ import { Table } from 'antd'; import { ColumnProps } from 'antd/lib/table'; -interface IUser { +interface User { key: number; name: string; } -const columns: ColumnProps[] = [{ +const columns: ColumnProps[] = [{ key: 'name', title: 'Name', dataIndex: 'name', }]; -const data: IUser[] = [{ +const data: User[] = [{ key: 0, name: 'Jack', }]; -class UserTable extends Table {} +class UserTable extends Table {} // 使用 JSX 风格的 API -class NameColumn extends Table.Column {} +class NameColumn extends Table.Column {} @@ -224,9 +224,9 @@ class NameColumn extends Table.Column {} // TypeScript 2.9 之后也可以这样写 // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#generic-type-arguments-in-jsx-elements - columns={columns} dataSource={data} /> - dataSource={data}> - key="name" title="Name" dataIndex="name" /> + columns={columns} dataSource={data} /> + dataSource={data}> + key="name" title="Name" dataIndex="name" /> ```