Closed danranVm closed 3 years ago
It is highly valid to display large lists by rendering only those visible on those on the screen. Reference from [RC-Virtual-List] (https://github.com/react-component/virtual-list)
The amount of data is too much for enhancing the page rendering performance.
Name | Description | Type | Default | Global Configuration | Remarks |
---|---|---|---|---|---|
Component |
Custom list Container Node | String \ | Component |
Div |
- | - |
Data |
Request Data List | Array |
[] |
- | |
FullHeight |
Whether to useheight as a container height |
Boolean |
false |
- | Just take effect only when you do not meet the virtual scrolling condition |
HEIGHT |
The height of the list | Number |
0 |
- | Set to be greater than 0 to enable virtual scrolling |
ItemHeight |
The height of the list item | Number |
0 |
- | Set to be greater than 0 to enable virtual scrolling |
ItemKey |
List of list items | String \ | Number \ | (item) => string \ | Number |
- | Must set | |
ItemRender |
List Item Rendering Functions | (option: {Item: T; Index: Number}) => vNodTypes \ | V-slot: item = {iTEM, INDEX} |
- | - | Must set or Provide Item slots |
Virtual |
Whether to turn on the virtual scroll | Boolean |
True |
- |
Name | Description | Parameter Type | Remarks |
---|---|---|---|
Scroll |
Scroll events | (EVT: Event) => void |
Name | Description | Parameter Type | Remarks |
---|---|---|---|
Scrollto |
Manually set scroll bar position | (Value ?: Number \ | scrolltoconfig) => void |
What problem does this feature solve?
What does the proposed API look like?
通过仅渲染那些屏幕上可见的条目,来高效的显示大型列表。参考自 rc-virtual-list
何时使用
数据量过多时,用于提升页面渲染性能。
API
ix-virtual-list
Props
component
string \| Component
div
data
Array
[]
fullHeight
height
作为容器高度boolean
false
height
number
0
itemHeight
number
0
itemKey
string \| number \| (item) => string \| number
itemRender
(option: { item: T; index: number }) => VNodeTypes \| v-slot:item={item, index}
item
插槽virtual
boolean
true
Emits
scroll
(evt: Event) => void
Method
scrollTo
(value?: number \| ScrollToConfig) => void