0.1.11 • Published 4 years ago

vue-recycler-list v0.1.11

Weekly downloads
49
License
-
Repository
github
Last release
4 years ago

vue-recycler-list

Github Page

Advantages

  • DOM Recycling
  • Async Dynamic Height Support, Auto Measure
  • Pull Down Refresh And Loadmore Support

Installation

npm install --save vue-recycler-list

Usage

import RecyclerList from 'vue-recycler-list';

Vue.component('RecyclerList', RecyclerList);

Example

<template>
  <div id="app">
    <div class="main-container">
      <RecyclerList
      uniqueKey="id"
      :itemList="itemList"
      :hasMore="hasMore"
      :usePullDownRefresh="true"
      @loadmore="onLoadMore"
      @refresh="onRefresh"
      >
        <template slot="item" slot-scope="props">
          <li class="chat-item" @click="onItemClick(props)">
            <img class="avatar" width="48" height="48" :src="props.data.avatar">
            <div class="bubble">
                <p>{{props.data.message}}</p>
                <img width="400" height="300" :class="{invisible:!props.data.photo}" :src="props.data.photo">
                <div class="meta">
                    <time class="posted-date">{{props.data.createAt}}</time>
                </div>
            </div>
          </li>
        </template>
        <template slot="footer">
          <div v-show="showLoading">
            loading...
          </div>
        </template>
    </RecyclerList>
    </div>
  </div>
</template>

demo

Props

keydescriptiondefualttype/options
itemListList data of RecyclerList[]Array
uniqueKeyField in item data, used to identify items and optimize rendered for 'v-for' of Vue.'id'String
estimatedItemHeightlist item estimated height68Number
hasMoreUse build-in loadmore feature or not.falseBoolean
loadawayItemsTrigger the 'loadmore' event when the list items to be displayed are less than loadawayItems.10Number
runawayItemsThe number of items beyond visable items.5Number
opsrunawayItemsThe number of items above visable items.5Number
usePullDownRefreshUse build-in pull down refresh feature or not.falseBoolean
pullDownOffsetThe value of pixels of pull down to trigger 'refresh' event.80Number
pullDownTipsThe text of pull down to refresh.'Pull to refresh'String
pullDownReleaseTipsThe text of release to refresh.'Pull to refresh'String
pullDownLoadingTipsThe text of loading.'Loading'String

Events

  • loadmore : emitted when the list items to be displayed are less than the loadawayItems.

  • refresh : emitted when the value of pixels of pull down large than the pullDownOffset.

Slots

  • item
  • footer

Reference

  1. Complexities of an Infinite Scroller
0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago