NG-ZORRO-MOBILE官网
在ionic4中使用 NG-ZORRO-MOBILE

我使用的是用npm引入的方式

1.安装组件
在ionic4中使用 NG-ZORRO-MOBILE

2.引入模块
在 app.modules.ts 中,全局引入 ng-zorro-antd-mobile。

在ionic4中使用 NG-ZORRO-MOBILE

3.引入样式
在 angular.json 中,全局引入 ng-zorro-antd-mobile样式。

在ionic4中使用 NG-ZORRO-MOBILE
4.在tab1.page.html使用NoticeBar组件

在ionic4中使用 NG-ZORRO-MOBILE
此时控制台报错:core.js:9110 ERROR Error: Uncaught (in promise): Error: Template parse errors:
Can’t bind to ‘option’ since it isn’t a known property of ‘NoticeBar’. ("

在ionic4中使用 NG-ZORRO-MOBILE

解决:需要在tab1.module.ts中,引入 ng-zorro-antd-mobile
在ionic4中使用 NG-ZORRO-MOBILE

效果:
在ionic4中使用 NG-ZORRO-MOBILE

相关文章: