vue 组件延时加载_一个基于Vue 2的简单的延迟加载列表组件

vue 组件延时加载

v2-懒惰列表 (v2-lazy-list)

A simple lazy-load list component based Vue 2.x, which will be on-demand rendering the list based container element's viewport.

一个基于Vue 2.x的简单的延迟加载列表组件,它将按需呈现基于列表的容器元素的视口。

v1.x is not maintained

v1.x未维护

安装 (Installation)

npm:

npm:

npm i --save v2-lazy-list beautify-scrollbar

or yarn

或纱线

yarn add  v2-lazy-list beautify-scrollbar

开始使用 (Get Started)

import Vue from 'vue';
import 'beautify-scrollbar/dist/index.css';
import V2LazyList from 'v2-lazy-list';

Vue.use(V2LazyList)

<v2-lazy-list :data="data"></v2-lazy-list>

可用道具 (Available Props)

AttributeTypeAccepted ValuesDefaultDescription
dataArray-[]the list data to render
heightString/Number-320the height of the content wrap element
item-heightString/Number-40the height of list item
thresholdString/Number-0the threshold value to trigger next-fetch in infinite scrolling
tagStringHTML tag name'ul'container elment tag
item-tagStringHTML tag name'li'item element tag
modeStringdemand/lazy'demand'render demand list or lazy list
属性 类型 接受值 默认 描述
数据 数组 -- [] 要呈现的列表数据
高度 字符串/数字 -- 320 内容包装元素的高度
项目高度 字符串/数字 -- 40 列表项的高度
字符串/数字 -- 0 无限滚动中触发下一次提取的阈值
标签 HTML标签名称 'ul' 容器标签标签
项目标签 HTML标签名称 “李” 项目元素标签
模式 需求/懒惰 '需求' 呈现需求列表或惰性列表

大事记 (Events)

Event NameDescriptionParameters
reach-thresholdtriggers when reaching threshold value-
活动名称 描述 参量
到达阈值 达到阈值时触发 --

发展历程 (Development)

git clone[email protected]:dwqs/v2-lazy-list.git

cd v2-lazy-list

npm i 

npm run dev

翻译自: https://vuejsexamples.com/a-simple-lazy-load-list-component-based-vue-2/

vue 组件延时加载

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值