afc163
9 years ago
3 changed files with 23 additions and 9 deletions
@ -1,25 +1,37 @@ |
|||||
import React from 'react'; |
import React from 'react'; |
||||
import Pagination from 'rc-pagination'; |
import Pagination from 'rc-pagination'; |
||||
import Select from 'rc-select'; |
import Select from '../select'; |
||||
import zhCN from './locale/zh_CN'; |
import zhCN from './locale/zh_CN'; |
||||
|
|
||||
const prefixCls = 'ant-pagination'; |
class MiniSelect extends React.Component { |
||||
|
render() { |
||||
|
return <Select size="small" {...this.props} />; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
MiniSelect.Option = Select.Option; |
||||
|
|
||||
class AntPagination extends React.Component { |
class AntPagination extends React.Component { |
||||
render() { |
render() { |
||||
let className = this.props.className; |
let className = this.props.className; |
||||
|
let selectComponentClass = Select; |
||||
|
|
||||
if (this.props.size === 'small') { |
if (this.props.size === 'small') { |
||||
className += ' mini'; |
className += ' mini'; |
||||
|
selectComponentClass = MiniSelect; |
||||
} |
} |
||||
return <Pagination selectComponentClass={Select} |
|
||||
|
return <Pagination selectComponentClass={selectComponentClass} |
||||
selectPrefixCls="ant-select" |
selectPrefixCls="ant-select" |
||||
prefixCls={prefixCls} |
{...this.props} |
||||
{...this.props} className={className}/>; |
className={className} />; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
AntPagination.defaultProps = { |
AntPagination.defaultProps = { |
||||
locale: zhCN, |
locale: zhCN, |
||||
|
className: '', |
||||
|
prefixCls: 'ant-pagination', |
||||
}; |
}; |
||||
|
|
||||
export default AntPagination; |
export default AntPagination; |
||||
|
Loading…
Reference in new issue