UNIET PEER DEPENDENCY @ ionic-native / core @ 3.4.4在安装angular2-virtual-scroll时无效

时间:2023-02-05 23:01:17

I developing an Ionic 2.3 Web app and need to use virtual scroll.

我开发了一个Ionic 2.3 Web应用程序,需要使用虚拟滚动。

But when I try to intall angular2-virtual-scroll library I get this error:

但是,当我尝试intall angular2-virtual-scroll库时,我收到此错误:

corp-now@ E:\Projetos\Ionic2\CorpNow
+-- UNMET PEER DEPENDENCY @ionic-native/core@3.4.4 invalid
`-- angular2-virtual-scroll@0.1.5

How could I solve this?

我该怎么解决这个问题?

2 个解决方案

#1


0  

Why do you need to add 3rd party module for the virtual scroll? It is an inbuilt feature of Ionic 2.

为什么需要为虚拟滚动添加第三方模块?它是Ionic 2的内置功能。

Virtual Scroll displays a virtual, "infinite" list. An array of records is passed to the virtual scroll containing the data to create templates for. The template created for each record, referred to as a cell, can consist of items, headers, and footers.

虚拟滚动显示虚拟的“无限”列表。将记录数组传递给包含要为其创建模板的数据的虚拟滚动。为每个记录创建的模板(称为单元格)可以包含项目,页眉和页脚。

For performance reasons, not every record in the list is rendered at once; instead a small subset of records (enough to fill the viewport) are rendered and reused as the user scrolls.

出于性能原因,并非列表中的每个记录都会立即呈现;相反,当用户滚动时,会渲染并重复使用一小部分记录(足以填充视口)。

Example:

例:

<ion-list [virtualScroll]="items">

  <ion-item *virtualItem="let item">
    {{ item }}
  </ion-item>

</ion-list>

You can read more about it on the doc here.

您可以在此处阅读有关该文档的更多信息。

#2


0  

It seems a problem with the Ionic 2/Angular 2 version.

这似乎是Ionic 2 / Angular 2版本的一个问题。

Solved by using Ionic 3 instead.

通过使用Ionic 3来解决。

#1


0  

Why do you need to add 3rd party module for the virtual scroll? It is an inbuilt feature of Ionic 2.

为什么需要为虚拟滚动添加第三方模块?它是Ionic 2的内置功能。

Virtual Scroll displays a virtual, "infinite" list. An array of records is passed to the virtual scroll containing the data to create templates for. The template created for each record, referred to as a cell, can consist of items, headers, and footers.

虚拟滚动显示虚拟的“无限”列表。将记录数组传递给包含要为其创建模板的数据的虚拟滚动。为每个记录创建的模板(称为单元格)可以包含项目,页眉和页脚。

For performance reasons, not every record in the list is rendered at once; instead a small subset of records (enough to fill the viewport) are rendered and reused as the user scrolls.

出于性能原因,并非列表中的每个记录都会立即呈现;相反,当用户滚动时,会渲染并重复使用一小部分记录(足以填充视口)。

Example:

例:

<ion-list [virtualScroll]="items">

  <ion-item *virtualItem="let item">
    {{ item }}
  </ion-item>

</ion-list>

You can read more about it on the doc here.

您可以在此处阅读有关该文档的更多信息。

#2


0  

It seems a problem with the Ionic 2/Angular 2 version.

这似乎是Ionic 2 / Angular 2版本的一个问题。

Solved by using Ionic 3 instead.

通过使用Ionic 3来解决。