2.0.0 • Published 3 years ago

vue-long-list-load v2.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

描述

主要应用长列表加载.解决长列表不固定高度的烦恼,

调用方式

  1. 安装vue-long-list-load:
npm install vue-long-list-load --save
  1. 项目内调用
import longList from 'vue-long-list-load'
<long-list 
  ref="vueLongList"
  dataKey='id' 
  scrollWrapId="manWrap"
  :dataList="dataList" 
  :dataComponent="dataComponent" 
  :componentProps="componentProps"
  height=100
  > 
</long-list>

参数说明

参数说明类型必填可选值默认值
scrollWrapId列表滚动容器idstringtrue
dataKey节点数据内唯一键值Stringtrue
dataList列表数据Arraytrue具体见下方说明
dataComponent自定义的节点组件true
ref调用组件内部方法stringfalse
direction滚动方向Numberfalse0:纵向,1横向0
hideIds列表中需要隐藏的节点Arrayfalse具体见下方说明[]
height节点高度Numberfalse100
componentProps节点组件要传递的参数Objectfalse{}
scroll滚动区域内滚动回调方法Functionfalse-
resized某个节点宽高发生变化回调方法Functionfalse具体见下方说明

部分参数说明

    <!--假设 dataKey=id-->
    
    <!--列表中需要隐藏的节点-->
    hideIds:[1, 2]
    <!--列表数据  dataList 内 height 为 **Number**。-->
    dataList:[
        {id:1,height:100},
        {id:2,height:200},
        {id:3,height:300},
        {id:4,height:300},
        {id:5,height:300}
    ]
    
   <!--节点高度-->
   height:100
   <!--如果dataList的数据内有height值 不需要设置这个height-->
   <!--如果dataList 和 height 都不传递的话,默认为100 可能滚动略有卡顿;-->
   <!--建议在每个高度都不相同的时候通过dataList传递,都相同时候通过height传递-->
   
   <!--某个节点宽高发生变化回调方法  返回参数为id 与高度-->
   resized(id, height){
       
   }
交流学习邮箱 antc_li@163.com
2.0.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago