您现在的位置是:首页 > 文章详情

ng-zorro-antd 20.0.0 发布,基于 Angular 的 UI 组件

日期:2025-07-02点击:7

ng-zorro-antd 是 Ant Design 的 Angular 实现,主要用于研发企业级中后台产品。全部代码开源并遵循 MIT 协议,任何企业、组织及个人均可免费使用。

ng-zorro-antd 20.0.0 正式发布,更新内容如下:

Features

  • cascader,date-picker,input-number,input,select,time-picker,tree-select: 新增 nzVariant 属性设置变体 (#9131) (b342bb4)
  • popover: 新增 nzPopoverTitleContext  nzPopoverContentContext 属性 (#9126) (df3ead9)
  • select: 新增 nzOnClear 事件回调 (#9188) (e047ac2)
  • avatar: 支持设置原生 <img>  loading  fetchpriority 属性 (#7347) (ff8419f)
  • popconfirm: 新增 nzOkButtonProps  nzCancelButtonProps (#9245) (22e2a9f)
  • tree-select: 支持以 innerHTML 渲染已选项的 title (#9259) (8066f7b)

Bug Fixes

  • flex: 修复 NzAlign 类型 (#9151) (b271c19)
  • segmented: 接受 ng control 的禁用状态 (#9166) (134cd59)
  • space: 紧凑模式下只有一个子元素时的 border-radius 不正确 (#9165) (d2f4541)
  • tabs: 修复 tab focus 时不正确的滚动行为 (#9186) (4f658e0)
  • schematics: 修复重复执行 ng add 时的问题 (#9171) (d0a9748)
  • water-mark: 修复 ssr 模式的兼容问题 (#9250) (a70a682)
  • icon: 在 animation frame 上增加渲染防抖 (#8579) (c0709d1)

Code Refactoring

  • core: 移除对 animation frame 的 polyfill (#9243) (272237a)
  • 从基于 constructor 的依赖注入模式迁移到 inject

BREAKING CHANGES

  • core: 移除对 animation frame 的 polyfill
    • 重命名 cancelRequestAnimationFrame  cancelAnimationFrame
    • 重命名 reqAnimFrame  requestAnimationFrame
  • tabs: 废弃 NzTabsetComponent 并重命名为 NzTabsComponent,废弃 nz-tabset 选择器并重命名为 nz-tabs
  • table: 移除对 material 组件的兼容
  • popconfirm: 废弃 nzOkDisabled  nzOkDanger,请使用 nzOkButtonProps 代替

移除以下在过去的版本中标记为废弃的 API:

Module API
ng-zorro-antd/button NzButtonGroupComponent
ng-zorro-antd/core/form NzFormPatchModule
ng-zorro-antd/checkbox NzCheckBoxOptionInterface
ng-zorro-antd/input NzInputGroupComponent#nzCompact
ng-zorro-antd/message NzMessageModule
ng-zorro-antd/notification NzNotificationModule
NzNotificationServiceModule

组件的 exportAs 属性命名统一采用小驼峰 camelCase 且以 nz 开头,并移除一些内部组件的 exportAs 属性。变化如下:

Component Original Current
calendar-footer calendarFooter -
date-helper dateHelper -
date-range-popup dateRangePopup -
date-table dateTable -
decade-helper decadeHelper -
decade-table decadeTable -
month-helper monthHelper -
month-table monthTable -
quarter-helper quarterHelper -
quarter-table quarterTable -
year-helper yearHelper -
year-table yearTable -
inner-popup innerPopup -
nz-color-block NzColorBlock nzColorBlock
nz-color-format NzColorFormat nzColorFormat
nz-color-picker NzColorPicker nzColorPicker
nz-model-close NzModalCloseBuiltin nzModalCloseBuiltin
nz-model-footer NzModalFooterBuiltin nzModalFooterBuiltin
nz-model-title NzModalTitleBuiltin nzModalTitleBuiltin
nz-tree-drop-indicator NzTreeDropIndicator nzTreeDropIndicator
nz-water-mark NzWaterMark nzWaterMark
nz-tabs nzTabset nzTabs

Deprecations

在 v20 中,以下 API 被标记为 deprecated,并将在下一个主要版本中移除。 请参考相关文档以获取更好的替代方案。

Module API
ng-zorro-antd/autocomplete NZ_AUTOCOMPLETE_VALUE_ACCESSOR
getNzAutocompleteMissingPanelError
ng-zorro-antd/button NzButtonGroupComponent
ng-zorro-antd/core/highlight NzHighlightModule
ng-zorro-antd/core/form NzFormPatchModule
ng-zorro-antd/checkbox NzCheckBoxOptionInterface
ng-zorro-antd/input NzInputGroupComponent#nzCompact
ng-zorro-antd/mention NZ_MENTION_TRIGGER_ACCESSOR
ng-zorro-antd/message NzMessageModule
ng-zorro-antd/notification NzNotificationModule
NzNotificationServiceModule
ng-zorro-antd/tabs NzTabsetComponent

更新说明:https://github.com/NG-ZORRO/ng-zorro-antd/releases/tag/20.0.0

原文链接:https://www.oschina.net/news/358357/ng-zorro-antd-20-0-0-released
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章