2017-04-12 73 views
1

我開發了一個Ionic 2.3 Web應用程序,需要使用虛擬滾動條。UNMET PEER DEPENDENCY @ ionic-native/core @ 3.4.4安裝無效angular2-virtual-scroll

但是當我嘗試intall angular2虛擬滾動圖書館中,我得到這個錯誤:

[email protected] E:\Projetos\Ionic2\CorpNow 
+-- UNMET PEER DEPENDENCY @ionic-native/[email protected] invalid 
`-- [email protected] 

我怎麼能解決這個問題?

+0

你可以顯示你的package.json嗎? –

+0

感謝您的回覆。這似乎是Ionic版本的一個問題。改用Ionic 3解決。 – Natanael

回答

0

這似乎與離子2 /角2版中的問題。

通過使用Ionic 3來解決。

0

爲什麼你需要爲虛擬卷軸添加第三方模塊?這是離子的內置功能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.

例子:

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

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

</ion-list> 

你可以閱讀更多關於它on the doc here.

+0

因爲Ionic 2的虛擬卷軸有一些限制。例如,我需要設置虛擬滾動大小和位置,但其虛擬滾動填充整個內容區域,並且不可能改變它。 – Natanael

相關問題