docs: update migrate desc

This commit is contained in:
二货机器人 2022-12-12 11:49:29 +08:00
parent f820cb257c
commit ad7501ccf8
2 changed files with 14 additions and 0 deletions

View File

@ -164,6 +164,13 @@ Use git to save your code and install latest version:
npm install --save antd@5.x
```
If you want to use v4 deprecated component like `Comment` or `PageHeader`. You can install `@ant-design/compatible` and `@ant-design/pro-layout` for compatible:
```bash
npm install --save @ant-design/compatible@v5-compatible-v4
npm install --save @ant-design/pro-layout
```
You can manually check the code one by one against the above list for modification. In addition, we also provide a codemod cli tool [@ant-design/codemod-v5](https://github.com/ant-design/codemod-v5) To help you quickly upgrade to v5.
Before running codemod cli, please submit your local code changes.

View File

@ -156,6 +156,13 @@ title: 从 v4 到 v5
npm install --save antd@5.x
```
如果你需要使用 v4 废弃组件如 `Comment`、`PageHeader`,请安装 `@ant-design/compatible``@ant-design/pro-layout` 做兼容:
```bash
npm install --save @ant-design/compatible@v5-compatible-v4
npm install --save @ant-design/pro-layout
```
你可以手动对照上面的列表逐条检查代码进行修改,另外,我们也提供了一个 codemod cli 工具 [@ant-design/codemod-v5](https://github.com/ant-design/codemod-v5) 以帮助你快速升级到 v5 版本。
在运行 codemod cli 前,请先提交你的本地代码修改。