1.1.0 • Published 3 years ago

virtual-list-scroll v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Demo

Install

npm i virtual-list-scroll

Import

import Vue from "vue"
import VirtualListScroll from "virtual-list-scroll"
Vue.use(VirtualListScroll)

Usage

Page Mode

<VirtualListScroll :data="blocks">
    <template slot-scope="{data}"></template>
</VirtualListScroll>

Container Mode

<VirtualListScroll :height="300" :pageMode="false" :data="blocks">
    <template slot-scope="{data}">
    </template>
</VirtualListScroll>

Flxed Block Height

<VirtualListScroll
  :height="300"
  :pageMode="false"
  :flxedBlockHeight="50"
  :data="blocks"
>
    <template slot-scope="{data}">
    </template>
</VirtualListScroll>

Unique virtual block

<VirtualListScroll :height="300" :pageMode="false" :data="blocks">
    <template slot-scope="{data}">
    <template v-if="data.id===0"></template>
    <template v-if="data.id===1"></template>
    </template>
</VirtualListScroll>

Props

NameTypeDefaultDescription
dataArray-必填项,列表中数组数据
heightNumber-虚拟滚动区域的高度
flxedBlockHeightNumber-每一个列表Item的高度
pageModeBooleantrue假定滚动条是在window上还是在指定的虚拟滚动盒子上

DataObjet

NameTypeDefaultDescription
idString/Number-必填项,虚拟列表渲染的唯一key
heightNumber-只有当flxedBlockHeight没有设定的时候才会使用这个值

License

MIT

1.1.0

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago