Skip to content

Commit 5d1f37a

Browse files
add locale demo
1 parent 68e6f25 commit 5d1f37a

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

examples/locale.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
placeholder

examples/locale.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* eslint func-names: 0, no-console: 0 */
2+
import React from 'react';
3+
import ReactDOM from 'react-dom';
4+
import Select from 'rc-select';
5+
import Pagination from 'rc-pagination';
6+
import localeInfo from 'rc-pagination/lib/locale/en_US';
7+
import 'rc-pagination/assets/index.less';
8+
import 'rc-select/assets/index.css';
9+
10+
function onShowSizeChange(current, pageSize) {
11+
console.log(current);
12+
console.log(pageSize);
13+
}
14+
15+
function onChange(current, pageSize) {
16+
console.log('onChange:current=', current);
17+
console.log('onChange:pageSize=', pageSize);
18+
}
19+
20+
ReactDOM.render(
21+
<Pagination
22+
selectComponentClass={Select}
23+
showQuickJumper
24+
showSizeChanger
25+
defaultPageSize={20}
26+
defaultCurrent={5}
27+
onShowSizeChange={onShowSizeChange}
28+
onChange={onChange}
29+
total={450}
30+
locale={localeInfo}
31+
/>
32+
, document.getElementById('__react-content'));

0 commit comments

Comments
 (0)