New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

virtual-list-scroll

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

virtual-list-scroll

一个可以让大量列表渲染无压力的虚拟滚动列表

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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

Keywords

virtual

FAQs

Package last updated on 17 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts