mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
Merge branch 'master' into feature
* master: fix: extra space docs(table): generic type arguments in jsx elements demo revert webpackbar
This commit is contained in:
commit
713b363a9b
@ -176,7 +176,7 @@ Properties for row selection.
|
||||
|
||||
## Using in TypeScript
|
||||
|
||||
```jsx
|
||||
```tsx
|
||||
import { Table } from 'antd';
|
||||
import { ColumnProps } from 'antd/lib/table';
|
||||
|
||||
@ -206,6 +206,13 @@ class NameColumn extends Table.Column<IUser> {}
|
||||
<UserTable dataSource={data}>
|
||||
<NameColumn key="name" title="Name" dataIndex="name" />
|
||||
</UserTable>
|
||||
|
||||
// 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
|
||||
<Table<IUser> columns={columns} dataSource={data} />
|
||||
<Table<IUser> dataSource={data}>
|
||||
<Table.Column<IUser> key="name" title="Name" dataIndex="name" />
|
||||
</Table>
|
||||
```
|
||||
|
||||
## Note
|
||||
|
@ -181,7 +181,7 @@ const columns = [{
|
||||
|
||||
## 在 TypeScript 中使用
|
||||
|
||||
```jsx
|
||||
```tsx
|
||||
import { Table } from 'antd';
|
||||
import { ColumnProps } from 'antd/lib/table';
|
||||
|
||||
@ -210,6 +210,14 @@ class NameColumn extends Table.Column<IUser> {}
|
||||
<UserTable dataSource={data}>
|
||||
<NameColumn key="name" title="Name" dataIndex="name" />
|
||||
</UserTable>
|
||||
|
||||
// TypeScript 2.9 之后也可以这样写
|
||||
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#generic-type-arguments-in-jsx-elements
|
||||
<Table<IUser> columns={columns} dataSource={data} />
|
||||
<Table<IUser> dataSource={data}>
|
||||
<Table.Column<IUser> key="name" title="Name" dataIndex="name" />
|
||||
</Table>
|
||||
|
||||
```
|
||||
|
||||
## 注意
|
||||
|
@ -174,7 +174,7 @@
|
||||
"typescript": "~3.1.1",
|
||||
"unified": "^7.0.0",
|
||||
"values.js": "^1.0.3",
|
||||
"webpackbar": "^3.0.3",
|
||||
"webpackbar": "^2.6.3",
|
||||
"xhr-mock": "^2.4.1",
|
||||
"xhr2": "^0.1.4"
|
||||
},
|
||||
|
@ -33,7 +33,7 @@ function usePrettyWebpackBar(config) {
|
||||
// use brand new progress bar.
|
||||
config.plugins.push(
|
||||
new WebpackBar({
|
||||
name: '📦 Site',
|
||||
name: '📦 Ant Design Site',
|
||||
minimal: false,
|
||||
})
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user