virtual-block
🌈Render what's visible
Install
npm i virtual-block
Import
Vue
Usage
Page Mode
<!-- self defined slots -->
Container Mode
<!-- self defined slots -->
Fixed Block Height
<!-- self defined slots -->
Unique virtual block
<!-- virtual block slot when id is 0 --> <!-- virtual block slot when id is 1 --> <!-- other virtual block slots -->
Props
Name | Type | Default | Description |
---|---|---|---|
data |
Array<DataObject> |
- | Required. An Array of Object used as the source data. |
height |
Number |
- | Required when pageMode is false . The height of the virtual block container. |
fixedBlockHeight |
Number |
- | Optional. Specify this prop will assume every block has the same height value and the height keys in data object will be ignored. Note use fixedBlockHeight will improve the performance. |
pageMode |
Boolean |
true |
Optional. true assumes the scroller will be on the window . false assumes the scroller will be on the virtual block container . |
DataObject
Name | Type | Default | Description |
---|---|---|---|
id |
String/Number | - | Required. Unique key for each virtual block. |
height |
Number | - | Required when prop fixedBlockHeight is not specified. The height of each virtual block. |
License
MIT