Skip to content

Commit 781ea48

Browse files
committed
ant v3 -> v4
1 parent ac3f005 commit 781ea48

35 files changed

+1113
-1002
lines changed

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@
2222
"url": "https://github.com/xpioneer/react-typescript/issues"
2323
},
2424
"dependencies": {
25-
"antd": "^3.25.1",
25+
"@ant-design/icons": "^4.6.2",
26+
"antd": "^4.16.11",
2627
"axios": "^0.19.0",
2728
"echarts": "^4.2.0-rc.2",
2829
"mobx": "^5.15.0",
2930
"mobx-react": "^6.1.4",
3031
"quill": "^1.3.7",
3132
"quill-image-resize-module": "^3.0.0",
32-
"react": "^16.11.0",
33-
"react-dom": "^16.11.0",
34-
"react-router-dom": "^5.1.2"
33+
"react": "^17.0.2",
34+
"react-dom": "^17.0.2",
35+
"react-router-dom": "^5.2.0"
3536
},
3637
"devDependencies": {
3738
"@babel/core": "^7.12.10",
@@ -42,9 +43,9 @@
4243
"@babel/preset-typescript": "^7.12.7",
4344
"@types/echarts": "^4.1.3",
4445
"@types/quill": "^2.0.1",
45-
"@types/react": "^16.7.7",
46-
"@types/react-dom": "^16.0.10",
47-
"@types/react-router-dom": "^4.3.1",
46+
"@types/react": "^17.0.17",
47+
"@types/react-dom": "^17.0.9",
48+
"@types/react-router-dom": "^5.1.8",
4849
"@typescript-eslint/eslint-plugin": "^4.10.0",
4950
"@typescript-eslint/parser": "^4.10.0",
5051
"babel-loader": "^8.2.2",

src/components/datePicker/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import dateFnsGenerateConfig from 'rc-picker/lib/generate/dateFns';
2+
import generatePicker from 'antd/es/date-picker/generatePicker';
3+
import 'antd/es/date-picker/style/index';
4+
5+
export const DatePicker = generatePicker<Date>(dateFnsGenerateConfig);

src/pages/article/articleCreate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
44
import Editor from '@components/editor'
55

66
const FormItem = Form.Item

src/pages/article/articleEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
44
import Editor from '@components/editor'
55

66
const FormItem = Form.Item

src/pages/article/articleList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Table, Modal, Badge, } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Table, Modal, Badge, } from 'antd'
44
import { ColumnProps } from 'antd/lib/table'
55
import { IArticle } from '@models/article'
66

@@ -53,11 +53,11 @@ export default class ArticleList extends React.Component<ICommonProps> {
5353
}]
5454

5555
viewDetail (data: IArticle) {
56-
this.props.history.push(`/home/blog-article/${data.id}`)
56+
this.props.history.push(`/home/blog/article/detail/${data.id}`)
5757
}
5858

5959
create = () => {
60-
this.props.history.push('/home/blog-articleCreate')
60+
this.props.history.push('/home/blog/article/create')
6161
}
6262

6363
componentDidMount () {

src/pages/articleType/articleTypeCreate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
44

55
const FormItem = Form.Item
66

src/pages/articleType/articleTypeEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
44

55
const FormItem = Form.Item
66

src/pages/articleType/articleTypeList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Table, Modal, Badge, } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Table, Modal, Badge, } from 'antd'
44
import { ColumnProps } from 'antd/lib/table'
55
import { IArticleType } from '@models/articleType'
66

@@ -51,11 +51,11 @@ export default class ArticleTypeList extends React.Component<ICommonProps> {
5151
}]
5252

5353
viewDetail (data: IArticleType) {
54-
this.props.history.push(`/home/blog-type/${data.id}`)
54+
this.props.history.push(`/home/blog/type/detail/${data.id}`)
5555
}
5656

5757
create = () => {
58-
this.props.history.push('/home/blog-typeCreate')
58+
this.props.history.push('/home/blog/type/create')
5959
}
6060

6161
componentDidMount () {

src/pages/comment/commentEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Select, Checkbox, Badge } from 'antd'
44

55
const FormItem = Form.Item
66

src/pages/comment/commentList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import {inject, observer} from 'mobx-react'
3-
import { Row, Col, Form, Icon, Input, Button, DatePicker, Table, Modal, Badge, } from 'antd'
3+
import { Row, Col, Form, Input, Button, DatePicker, Table, Modal, Badge, } from 'antd'
44
import { ColumnProps } from 'antd/lib/table'
55
import { IComment } from '@models/comment'
66

@@ -49,7 +49,7 @@ export default class CommentList extends React.Component<ICommonProps> {
4949
}]
5050

5151
viewDetail (data: IComment) {
52-
this.props.history.push(`/home/blog-comment/${data.id}`)
52+
this.props.history.push(`/home/blog/comment/${data.id}`)
5353
}
5454

5555
componentDidMount () {

0 commit comments

Comments
 (0)