注意:ion-slides在 v6.0.0 版本中已经被弃用,在v7.0.0版本中被移除,官方推荐直接使用 Swiper.js库。
https://ionicframework.com/docs/angular/slides
问题
‘ion-slides’ is not a known element:
- If ‘ion-slides’ is an Angular component, then verify that it is part of this module.
- If ‘ion-slides’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.ngtsc(-998001)
app.component.ts(9, 11): Error occurs in the template of component AppComponent.
解决
修改app.module.ts文件:
现在就不报错了: