angular - ion-virtual-scroll 不是已知元素
问题描述
<ion-virtual-scroll [items]="churchNewsList" approxItemHeight="120px">
<ion-item *virtualItem="let news">
{{ news }}
</ion-item>
</ion-virtual-scroll>
我收到此错误
Can't bind to 'items' since it isn't a known property of 'ion-virtual-scroll'.
1. If 'ion-virtual-scroll' is an Angular component and it has 'items' input, then verify that it is part of this module.
2. If 'ion-virtual-scroll' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
如前所述,如何将其包含在 NgModule 中。官方文档没有这样说。
解决方案
我有类似的问题,但是我发现的搜索ion-scroll
不再存在,div
可以改用
以上css
可以实现如下
div[scrollx=true],div[scrolly=true] {
position: relative;
overflow: hidden;
}
div[scrollx=true] {
overflow-x: auto;
}
div[scrolly=true] {
overflow-y: auto;
}
解决方案来自Ionic Team
你在这里看到的
推荐阅读
- react-native - 如何撤消 react-native-upgrade?
- php - Having difficulties displaying all content on my wishlist table
- javascript - Promise.all() 函数中的 JS 'await 仅在异步函数中有效'
- assembly - Irvine ch10. Three-Operand Instructions using Macro in MASM
- javascript - Angular: Load dynamic component
- css - Cropping the top 10% of an image using CSS?
- apollo-server - Apollo Federation 网关和另一个服务器实现
- python - Get following dict structure in Python?
- wpf - WPF - 在鼠标悬停时将背景从线性更改为实心
- java - 为什么当我尝试在 Firebase 数据库中写入时出现此错误?与 FirebaseApp$IdTokenListener 相关