You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1 KiB

import React from 'react';
import RcPagination from 'rc-pagination';
import Select from '../select';
9 years ago
import zhCN from './locale/zh_CN';
class MiniSelect extends React.Component {
render() {
return <Select size="small" {...this.props} />;
}
}
MiniSelect.Option = Select.Option;
export default class Pagination extends React.Component {
render() {
let className = this.props.className;
let selectComponentClass = Select;
let locale;
if (this.context.antLocale && this.context.antLocale.Pagination) {
locale = this.context.antLocale.Pagination;
} else {
locale = this.props.locale;
}
if (this.props.size === 'small') {
className += ' mini';
selectComponentClass = MiniSelect;
}
return (
<RcPagination selectComponentClass={selectComponentClass}
selectPrefixCls="ant-select"
{...this.props}
locale={locale}
className={className} />
);
}
}
9 years ago
Pagination.defaultProps = {
9 years ago
locale: zhCN,
className: '',
prefixCls: 'ant-pagination',
9 years ago
};
Pagination.contextTypes = {
antLocale: React.PropTypes.object,
};