From b0536c2a43a30edbe301b3bb16e4cc1be9e8588b Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Tue, 4 Aug 2020 17:49:31 +0800 Subject: [PATCH] docs: update table demo action (#26010) --- .../__tests__/__snapshots__/demo.test.js.snap | 705 ++++++++++-------- components/table/demo/dynamic-settings.md | 8 +- .../table/demo/nest-table-border-debug.md | 6 +- components/table/demo/nested-table.md | 6 +- components/table/demo/pagination.md | 18 +- 5 files changed, 430 insertions(+), 313 deletions(-) diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index aa6646f39e..3256f13669 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -2919,38 +2919,47 @@ Array [ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ - - + +
- More actions - - - - - + + + +
+ @@ -11463,16 +11553,25 @@ exports[`renders ./components/table/demo/pagination.md correctly 1`] = ` - - + + + - - + + + - - + + + diff --git a/components/table/demo/dynamic-settings.md b/components/table/demo/dynamic-settings.md index f82548b3de..d9e7e62125 100644 --- a/components/table/demo/dynamic-settings.md +++ b/components/table/demo/dynamic-settings.md @@ -14,7 +14,7 @@ title: Select different settings to see the result. ```jsx -import { Table, Switch, Radio, Form } from 'antd'; +import { Table, Switch, Radio, Form, Space } from 'antd'; import { DownOutlined } from '@ant-design/icons'; const columns = [ @@ -47,12 +47,12 @@ const columns = [ key: 'action', sorter: true, render: () => ( - - Delete + + Delete More actions - + ), }, ]; diff --git a/components/table/demo/nest-table-border-debug.md b/components/table/demo/nest-table-border-debug.md index dacc4c59c8..59151e24a9 100644 --- a/components/table/demo/nest-table-border-debug.md +++ b/components/table/demo/nest-table-border-debug.md @@ -15,7 +15,7 @@ debug: true To see if bordered style applied to other tables. ```jsx -import { Table, Badge, Menu, Dropdown, Switch, Form } from 'antd'; +import { Table, Badge, Menu, Dropdown, Switch, Form, Space } from 'antd'; import { DownOutlined } from '@ant-design/icons'; const menu = ( @@ -47,7 +47,7 @@ function NestedTable() { dataIndex: 'operation', key: 'operation', render: () => ( - + Pause Stop @@ -55,7 +55,7 @@ function NestedTable() { More - + ), }, ]; diff --git a/components/table/demo/nested-table.md b/components/table/demo/nested-table.md index c9305f176f..66ed9a07a6 100644 --- a/components/table/demo/nested-table.md +++ b/components/table/demo/nested-table.md @@ -14,7 +14,7 @@ title: Showing more detailed info of every row. ```jsx -import { Table, Badge, Menu, Dropdown } from 'antd'; +import { Table, Badge, Menu, Dropdown, Space } from 'antd'; import { DownOutlined } from '@ant-design/icons'; const menu = ( @@ -45,7 +45,7 @@ function NestedTable() { dataIndex: 'operation', key: 'operation', render: () => ( - + Pause Stop @@ -53,7 +53,7 @@ function NestedTable() { More - + ), }, ]; diff --git a/components/table/demo/pagination.md b/components/table/demo/pagination.md index 268fca7f6f..a4a7605151 100644 --- a/components/table/demo/pagination.md +++ b/components/table/demo/pagination.md @@ -14,7 +14,7 @@ title: Table pagination settings. ```jsx -import { Table, Tag, Radio } from 'antd'; +import { Table, Tag, Radio, Space } from 'antd'; const topOptions = [ { label: 'topLeft', value: 'topLeft' }, @@ -35,7 +35,7 @@ const columns = [ title: 'Name', dataIndex: 'name', key: 'name', - render: (text) => {text}, + render: text => {text}, }, { title: 'Age', @@ -51,9 +51,9 @@ const columns = [ title: 'Tags', key: 'tags', dataIndex: 'tags', - render: (tags) => ( + render: tags => ( - {tags.map((tag) => { + {tags.map(tag => { let color = tag.length > 5 ? 'geekblue' : 'green'; if (tag === 'loser') { color = 'volcano'; @@ -71,10 +71,10 @@ const columns = [ title: 'Action', key: 'action', render: (text, record) => ( - - Invite {record.name} + + Invite {record.name} Delete - + ), }, ]; @@ -117,7 +117,7 @@ class Demo extends React.Component { style={{ marginBottom: 10 }} options={topOptions} value={this.state.top} - onChange={(e) => { + onChange={e => { this.setState({ top: e.target.value }); }} /> @@ -126,7 +126,7 @@ class Demo extends React.Component { style={{ marginBottom: 10 }} options={bottomOptions} value={this.state.bottom} - onChange={(e) => { + onChange={e => { this.setState({ bottom: e.target.value }); }} />