ng-zorro-antd icon indicating copy to clipboard operation
ng-zorro-antd copied to clipboard

NG-ZORRO V14 Upgrade Guide/ 升级指南

Open simplejason opened this issue 3 years ago • 5 comments

English Version

This guide applies to the current version ng-zorro-antd >= 14; If you encounter problems during the upgrade process, feel free to comment here. If you find any errors in this guide, please point out Or you have encountered a new problem and solved it, welcome to comment here.

Before upgrade

  1. Make sure Node.js >= 14.15.5 or >= 16.10.0.
  2. Create a new branch, or use other methods to back up the current project.
  3. Delete the package-lock.json file.

1.Upgrade dependencies

  • Upgrade Angular to 14.x version, ref https://update.angular.io/ .
  • Run ng update @angular/cdk, if you have used @angular/cdk.

2.Upgrade NG-ZORRO

  • Run ng update ng-zorro-antd.
  • If any warning messages appear in the console, follow the prompts to modify the corresponding code.

Common Problems


中文版

本指南适用于当前版本 ng-zorro-antd >= 14 ; 如果在升级过程中遇到问题,欢迎提出。提问前请阅读 如何向开源社区提问题 如果发现本指南存在遗漏/错误,请指出! 或者你遇到了新的问题并解决了,欢迎补充!

开始之前

  1. 首先确保你 Node.js >= 14.15.5 或 >= 16.10.0
  2. 创建新的分支,或者使用其他方式备份当前项目
  3. 删除项目下 package-lock.json 文件

升级步骤

1. 升级相关依赖

  • 前往 https://update.angular.io/ 将项目升级到 Angular 14。
  • 如果你有单独使用 @angular/cdk 请执行 ng update @angular/cdk

2.升级 NG-ZORRO

  • 运行 ng update ng-zorro-antd
  • 如果控制台出现警告消息请按提示修改对应代码

常见问题

样式不符

  • icon 使用方式从 i 元素切换为 span 元素,如果切换到新的使用方式导致样式未按预期渲染,请确保 css 选择器正确书写
  • pagination 组件增加 ul 标签以适应语义化,确保样式中没有 nz-pagination > li 这样的选择器

simplejason avatar Aug 23 '22 07:08 simplejason

Translation of this issue:

WIP NG-Zorro V14 Upgrade Guide/ Upgrade Guide

Todo

zorro-bot[bot] avatar Aug 23 '22 07:08 zorro-bot[bot]

为什么我升级后,页面反复自动刷新,当修改文件后。强刷后又正常了。

232650413 avatar Aug 29 '22 06:08 232650413

为什么我升级后,页面反复自动刷新,当修改文件后。强刷后又正常了。

有复现吗?

simplejason avatar Oct 09 '22 06:10 simplejason

为什么我升级后,页面反复自动刷新,当修改文件后。强刷后又正常了。

有复现吗?

没有,空了我再试试

232650413 avatar Oct 09 '22 06:10 232650413

./projects/mgr/src/styles.less - Error: Module build failed (from ./node_modules/less-loader/dist/cjs.js):

// @import './variable.less'; @import './@{root-entry-name}.less'; ^ Variable @root-entry-name is undefined Error in ./code/front/node_modules/ng-zorro-antd/style/themes/index.less (line 7, column 8)

portalZYT avatar Jun 07 '24 10:06 portalZYT