简体   繁体   English

角度 7 中的虚拟滚动、拖放

[英]virtual scrolling, drag and drop in angular 7

I searched the internet for these new features of angular 7, but didn't fully understand it.我在互联网上搜索了 angular 7 的这些新功能,但并没有完全理解它。

I went through drag and drop and virtual scrolling我经历了拖放虚拟滚动

Could someone please shed some light on these?有人可以对这些有所了解吗?

now consider a case where you are to display huge chunk of data, now either you will do pagination which will include an api call per page (if data changes frequently) or if you load everything at once which will slow down or kill UI process.现在考虑一种情况,您要显示大量数据,现在要么进行分页,其中包括每页的 api 调用(如果数据经常更改),要么一次加载所有内容,这会减慢或终止 UI 进程。

Virtual Scroll is about loading huge chunk of data in DOM without hampering the performance. Virtual Scroll 是在不影响性能的情况下在 DOM 中加载大量数据。

it's key features are:它的主要特点是:

  1. data is displayed as per size of viewport ie if you container div is 500 px it will show around 10-15 rows at a time.数据根据视口的大小显示,即如果您的容器 div 为 500 像素,它将一次显示大约 10-15 行。
  2. Ad you scroll these rows are changed but number of elements in the DOM will remain consistent.您滚动这些行的广告已更改,但 DOM 中的元素数量将保持一致。
  3. This is handy when you have to show huge chunk of data without implementing pagination.当您必须在不实施分页的情况下显示大量数据时,这很方便。

Thus it improves the UI performance.因此,它提高了 UI 性能。 I implemented Virtual list displaying multiple column and array length was 1 million which is a huge amount of data to display at a time.我实现了显示多列的虚拟列表,数组长度为 100 万,这是一次要显示的大量数据。 Virtual list is implemented over virtual scroll and it supports multiple columns.虚拟列表是通过虚拟滚动实现的,它支持多列。 check out detailed explanation and code here: https://www.codeproject.com/Articles/5260356/Virtual-List-in-Angular please have a look in the image:在此处查看详细说明和代码: https : //www.codeproject.com/Articles/5260356/Virtual-List-in-Angular请查看图像: 这就是它查看行数和 dom[1] 的内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM