Skip to content

Commit 9939035

Browse files
orzyyyyafc163
authored andcommitted
pref: add polyfill
1 parent a889816 commit 9939035

File tree

2 files changed

+77
-71
lines changed

2 files changed

+77
-71
lines changed

package.json

Lines changed: 71 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,71 @@
1-
{
2-
"name": "rc-pagination",
3-
"version": "1.17.3",
4-
"description": "pagination ui component for react",
5-
"keywords": [
6-
"react",
7-
"react-component",
8-
"react-pagination",
9-
"pagination"
10-
],
11-
"homepage": "http://github.com/react-component/pagination",
12-
"author": "i@xiaoba.me",
13-
"repository": {
14-
"type": "git",
15-
"url": "git@github.com:react-component/pagination.git"
16-
},
17-
"bugs": {
18-
"url": "http://github.com/react-component/pagination/issues"
19-
},
20-
"license": "MIT",
21-
"files": [
22-
"dist",
23-
"lib",
24-
"es",
25-
"assets/*.css"
26-
],
27-
"main": "lib/index",
28-
"module": "es/index",
29-
"config": {
30-
"port": 3000,
31-
"entry": {
32-
"rc-pagination": [
33-
"./src/index.js",
34-
"./assets/index.less"
35-
]
36-
}
37-
},
38-
"scripts": {
39-
"dist": "rc-tools run dist",
40-
"build": "rc-tools run build",
41-
"compile": "rc-tools run compile --babel-runtime",
42-
"gh-pages": "rc-tools run gh-pages",
43-
"start": "rc-tools run server",
44-
"pub": "rc-tools run pub --babel-runtime",
45-
"lint": "rc-tools run lint",
46-
"lint:fix": "rc-tools run lint --fix",
47-
"karma": "rc-test run karma",
48-
"saucelabs": "rc-test run saucelabs",
49-
"test": "rc-test run test",
50-
"chrome-test": "rc-test run chrome-test",
51-
"coverage": "rc-test run coverage"
52-
},
53-
"devDependencies": {
54-
"core-js": "^2.5.1",
55-
"expect.js": "0.3.x",
56-
"pre-commit": "1.x",
57-
"rc-select": "6.x",
58-
"rc-test": "^6.0.1",
59-
"rc-tools": "6.x",
60-
"react": "^16.5.2",
61-
"react-dom": "^16.5.2"
62-
},
63-
"pre-commit": [
64-
"lint"
65-
],
66-
"dependencies": {
67-
"babel-runtime": "6.x",
68-
"prop-types": "^15.5.7"
69-
}
70-
}
1+
{
2+
"name": "rc-pagination",
3+
"version": "1.17.3",
4+
"description": "pagination ui component for react",
5+
"keywords": [
6+
"react",
7+
"react-component",
8+
"react-pagination",
9+
"pagination"
10+
],
11+
"homepage": "http://github.com/react-component/pagination",
12+
"author": "i@xiaoba.me",
13+
"repository": {
14+
"type": "git",
15+
"url": "git@github.com:react-component/pagination.git"
16+
},
17+
"bugs": {
18+
"url": "http://github.com/react-component/pagination/issues"
19+
},
20+
"license": "MIT",
21+
"files": [
22+
"dist",
23+
"lib",
24+
"es",
25+
"assets/*.css"
26+
],
27+
"main": "lib/index",
28+
"module": "es/index",
29+
"config": {
30+
"port": 3000,
31+
"entry": {
32+
"rc-pagination": [
33+
"./src/index.js",
34+
"./assets/index.less"
35+
]
36+
}
37+
},
38+
"scripts": {
39+
"dist": "rc-tools run dist",
40+
"build": "rc-tools run build",
41+
"compile": "rc-tools run compile --babel-runtime",
42+
"gh-pages": "rc-tools run gh-pages",
43+
"start": "rc-tools run server",
44+
"pub": "rc-tools run pub --babel-runtime",
45+
"lint": "rc-tools run lint",
46+
"lint:fix": "rc-tools run lint --fix",
47+
"karma": "rc-test run karma",
48+
"saucelabs": "rc-test run saucelabs",
49+
"test": "rc-test run test",
50+
"chrome-test": "rc-test run chrome-test",
51+
"coverage": "rc-test run coverage"
52+
},
53+
"devDependencies": {
54+
"core-js": "^2.5.1",
55+
"expect.js": "0.3.x",
56+
"pre-commit": "1.x",
57+
"rc-select": "6.x",
58+
"rc-test": "^6.0.1",
59+
"rc-tools": "6.x",
60+
"react": "^16.5.2",
61+
"react-dom": "^16.5.2"
62+
},
63+
"pre-commit": [
64+
"lint"
65+
],
66+
"dependencies": {
67+
"babel-runtime": "6.x",
68+
"prop-types": "^15.5.7",
69+
"react-lifecycles-compat": "^3.0.4"
70+
}
71+
}

src/Pagination.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Pager from './Pager';
44
import Options from './Options';
55
import KEYCODE from './KeyCode';
66
import LOCALE from './locale/zh_CN';
7+
import { polyfill } from 'react-lifecycles-compat';
78

89
function noop() {
910
}
@@ -26,7 +27,7 @@ function calculatePage(p, state, props) {
2627
return Math.floor((props.total - 1) / pageSize) + 1;
2728
}
2829

29-
export default class Pagination extends React.Component {
30+
class Pagination extends React.Component {
3031
static propTypes = {
3132
prefixCls: PropTypes.string,
3233
current: PropTypes.number,
@@ -646,3 +647,7 @@ export default class Pagination extends React.Component {
646647
);
647648
}
648649
}
650+
651+
polyfill(Pagination);
652+
653+
export default Pagination;

0 commit comments

Comments
 (0)