mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
update small examples
This commit is contained in:
parent
9582855255
commit
36e234de97
@ -9,7 +9,9 @@
|
||||
````jsx
|
||||
import { Pagination } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Pagination size="small" defaultCurrent={2} total={50} />,
|
||||
document.getElementById('components-pagination-demo-mini'));
|
||||
ReactDOM.render(<div>
|
||||
<Pagination size="small" total={50} />
|
||||
<br />
|
||||
<Pagination size="small" total={50} showSizeChanger showQuickJumper />
|
||||
</div>, document.getElementById('components-pagination-demo-mini'));
|
||||
````
|
||||
|
@ -1,12 +1,8 @@
|
||||
import assign from 'object-assign';
|
||||
|
||||
import React from 'react';
|
||||
import Pagination from 'rc-pagination';
|
||||
import Select from '../select';
|
||||
import zhCN from './locale/zh_CN';
|
||||
|
||||
const prefixCls = 'ant-pagination';
|
||||
|
||||
class MiniSelect extends React.Component {
|
||||
render() {
|
||||
return <Select size="small" {...this.props} />;
|
||||
@ -18,36 +14,24 @@ MiniSelect.Option = Select.Option;
|
||||
class AntPagination extends React.Component {
|
||||
render() {
|
||||
let className = this.props.className;
|
||||
|
||||
if (this.props.simple) {
|
||||
// hijiking simple pagination
|
||||
let newProps = assign({}, this.props);
|
||||
delete newProps.simple;
|
||||
|
||||
className += ' mini';
|
||||
|
||||
return <Pagination selectComponentClass={MiniSelect}
|
||||
selectPrefixCls="ant-select"
|
||||
prefixCls={prefixCls}
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
{...newProps} className={className}/>;
|
||||
}
|
||||
let selectComponentClass = Select;
|
||||
|
||||
if (this.props.size === 'small') {
|
||||
className += ' mini';
|
||||
selectComponentClass = MiniSelect;
|
||||
}
|
||||
|
||||
return <Pagination selectComponentClass={Select}
|
||||
return <Pagination selectComponentClass={selectComponentClass}
|
||||
selectPrefixCls="ant-select"
|
||||
prefixCls={prefixCls}
|
||||
{...this.props} className={className}/>;
|
||||
{...this.props}
|
||||
className={className} />;
|
||||
}
|
||||
}
|
||||
|
||||
AntPagination.defaultProps = {
|
||||
locale: zhCN,
|
||||
className: '',
|
||||
prefixCls: 'ant-pagination',
|
||||
};
|
||||
|
||||
export default AntPagination;
|
||||
|
@ -105,7 +105,7 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding-left: 10px;
|
||||
padding-left: 8px;
|
||||
padding-right: 24px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user