时间:2021-04-14 09:03:22 | 栏目:AngularJS | 点击:次
在ng-alain中,使用ng-zorro图标库,发现部分能正常显示,部分并不能显示,在控制台同时发现出错报错。
ERROR Error: [@ant-design/icons-angular]: the icon redo-o does not exist or is not registered.
at IconNotFoundError (ant-design-icons-angular.js:159)
at MapSubscriber.project (ant-design-icons-angular.js:343)
...
出现以上问题是没有对相对的图标进行导入,并导出。
ng-alain默认只导入了图标库的几十个图标,在 style-icons-auto.ts可进行查看。
因此可以参考style-icons-auto.ts,把你所需要的图标进行import and export
ng-zorro图标库:https://ng.ant.design/compone...
PS:下面看下ng-zorro等组件默认样式的修改
在项目中修改ng-zorro组件默认样式的一些方法:
::ng-deep .ant-spin-dot i {
background-color: #4c7bff;
}
:host ::ng-deep .ant-spin-dot i {
background-color: #4c7bff;
}
:root .ant-select-dropdown {
background-color: #1F273E;
font-size: 14px;
margin-top: 16px;
}
:host /deep/ .ant-spin-dot i {
background-color: #4c7bff;
}
注意:上面三种方法可分别尝试一下,不同情况下其中之一会生效。
截止目前最新的7.0.0-rc.0 版本
table组件tbody中的td中的内容超出时默认会换行,想要实现xxxx...的效果需要一个hack:
::ng-deep .ant-table-tbody > tr > td {
max-width: 0;
white-space: nowrap;
}
总结