Search Doc

This commit is contained in:
zuiidea
2017-01-09 23:02:21 +08:00
parent 41ed8233b7
commit 9963e753d4
9 changed files with 145 additions and 37 deletions
+33 -29
View File
@@ -1,6 +1,6 @@
import React from 'react'
import { Ico } from '../../components/ui'
import { Table } from 'antd'
import { Table, Row, Col } from 'antd'
import styles from './ico.less'
const iconlist = ['Cherry', 'Cheese', 'Bread', 'Beer', 'Beet', 'Bacon', 'Banana', 'Asparagus', 'Apple']
@@ -10,34 +10,38 @@ const IcoPage = () => <div className='content-inner'>
{iconlist.map(item => <li key={item}><Ico className={styles.icon} type={item} /><span className={styles.name}>{item}</span></li>)}
</ul>
<h2 style={{margin: '16px 0'}}>Props</h2>
<Table rowKey={(record, key) => key}
pagination={false}
bordered
columns={[
{
title: '参数',
dataIndex: 'props'
},
{
title: '说明',
dataIndex: 'desciption'
},
{
title: '类型',
dataIndex: 'type'
},
{
title: '默认值',
dataIndex: 'default'
}
]}
dataSource={[
{
props: 'type',
desciption: '图标类型',
type: 'string',
default: '-'
}]} />
<Row>
<Col lg={18} md={24}>
<Table rowKey={(record, key) => key}
pagination={false}
bordered
columns={[
{
title: '参数',
dataIndex: 'props'
},
{
title: '说明',
dataIndex: 'desciption'
},
{
title: '类型',
dataIndex: 'type'
},
{
title: '默认值',
dataIndex: 'default'
}
]}
dataSource={[
{
props: 'type',
desciption: '图标类型',
type: 'String',
default: '-'
}]} />
</Col>
</Row>
</div>
export default IcoPage
+89
View File
@@ -0,0 +1,89 @@
import React from 'react'
import { Search } from '../../components/ui'
import { Table, Row, Col, Card } from 'antd'
const SearchPage = () => <div className='content-inner'>
<Row gutter={32}>
<Col lg={8} md={12}>
<Card title='默认'>
<Search />
</Card>
</Col>
<Col lg={8} md={12}>
<Card title='附带选择'>
<Search {...{
select: true,
selectOptions: [{ value: 'components', name: '组件' }, { value: 'page', name: '页面' }],
selectProps: {
defaultValue: 'components'
}
}} />
</Card>
</Col>
<Col lg={8} md={12}>
<Card title='大小'>
<Search size='large' style={{marginBottom: 16}} />
<Search size='small' />
</Card>
</Col>
</Row>
<h2 style={{margin: '16px 0'}}>Props</h2>
<Row>
<Col lg={18} md={24}>
<Table rowKey={(record, key) => key}
pagination={false}
bordered
columns={[
{
title: '参数',
dataIndex: 'props'
},
{
title: '说明',
dataIndex: 'desciption'
},
{
title: '类型',
dataIndex: 'type'
},
{
title: '默认值',
dataIndex: 'default'
}
]}
dataSource={[
{
props: 'size',
desciption: '设置Search大小,可选值为 【small】 【large】 或者不设',
type: 'String',
default: '-'
},
{
props: 'select',
desciption: '设置是否有选择器',
type: 'Boolean',
default: 'false'
},
{
props: 'selectOptions',
desciption: '选择器的选项,格式为[{name:"",value:""}]或者[{value:""}]',
type: 'Array',
default: '-'
},
{
props: 'selectProps',
desciption: '选择器的属性,可参考antd的【Select】组件',
type: 'Object',
default: '-'
},
{
props: 'onSearch',
desciption: '点击搜索按钮或者点击清除时的回调',
type: 'Function({keyword:string,field:string})',
default: '-'
}]} />
</Col>
</Row>
</div>
export default SearchPage
View File