docs: Add Table pagination position to demo

This commit is contained in:
Wei Zhu 2018-03-02 12:35:25 +08:00
parent ae2990e241
commit a4fea8f22c

View File

@ -65,12 +65,13 @@ const title = () => 'Here is title';
const showHeader = true; const showHeader = true;
const footer = () => 'Here is footer'; const footer = () => 'Here is footer';
const scroll = { y: 240 }; const scroll = { y: 240 };
const pagination = { position: 'both' };
class Demo extends React.Component { class Demo extends React.Component {
state = { state = {
bordered: false, bordered: false,
loading: false, loading: false,
pagination: true, pagination: false,
size: 'default', size: 'default',
expandedRowRender, expandedRowRender,
title, title,
@ -114,6 +115,10 @@ class Demo extends React.Component {
this.setState({ scroll: enable ? scroll : undefined }); this.setState({ scroll: enable ? scroll : undefined });
} }
handlePaginationChange = (enable) => {
this.setState({ pagination: enable ? pagination : false });
}
render() { render() {
const state = this.state; const state = this.state;
return ( return (
@ -127,7 +132,7 @@ class Demo extends React.Component {
<Switch checked={state.loading} onChange={this.handleToggle('loading')} /> <Switch checked={state.loading} onChange={this.handleToggle('loading')} />
</FormItem> </FormItem>
<FormItem label="Pagination"> <FormItem label="Pagination">
<Switch checked={state.pagination} onChange={this.handleToggle('pagination')} /> <Switch checked={state.pagination} onChange={this.handlePaginationChange} />
</FormItem> </FormItem>
<FormItem label="Title"> <FormItem label="Title">
<Switch checked={!!state.title} onChange={this.handleTitleChange} /> <Switch checked={!!state.title} onChange={this.handleTitleChange} />