All Projects → hilongjw → Vue Recyclerview

hilongjw / Vue Recyclerview

Licence: mit
Mastering Large Lists with the vue-recyclerview

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Vue Recyclerview

Multitype
【MultiType】可以轻松地实现RecyclerView显示多种数据类型,数据对应布局一对多、多对多、多对一,可以注册全局类型、局部类型、默认类型
Stars: ✭ 80 (-94.45%)
Mutual labels:  recyclerview
Recyclerviewheader
[DEPRECATED] Super fast and easy way to create header for Android RecyclerView
Stars: ✭ 1,312 (-9.02%)
Mutual labels:  recyclerview
Toro
Video list auto playback made simple, specially built for RecyclerView
Stars: ✭ 1,380 (-4.3%)
Mutual labels:  recyclerview
Expandable Recycler View
[DEPRECATED]
Stars: ✭ 1,234 (-14.42%)
Mutual labels:  recyclerview
Recyclerview Examples
Samples to learn about RecyclerView
Stars: ✭ 87 (-93.97%)
Mutual labels:  recyclerview
Dragview2fill
ViewDragHelper结合RecyclerView的使用示例
Stars: ✭ 94 (-93.48%)
Mutual labels:  recyclerview
Rxbanner
一个灵活可制定的基于 Recyclerview 的轮播图控件,支持自动轮播,无限循环。 同时可关闭无限循环变成 引导页 ,带有引导完成接口回调
Stars: ✭ 77 (-94.66%)
Mutual labels:  recyclerview
Multi Type Adapter
Super simple and easy to use common multi-type-adapter by android data-binding
Stars: ✭ 102 (-92.93%)
Mutual labels:  recyclerview
Videolistplayer
Play video in ListView or RecyclerView
Stars: ✭ 1,308 (-9.29%)
Mutual labels:  recyclerview
Multi Selection
Multiselection Solution for Android in Kotlin
Stars: ✭ 1,361 (-5.62%)
Mutual labels:  recyclerview
Pinnedrecyclerview Android
Add a list pinned by a floating label (text or image)
Stars: ✭ 81 (-94.38%)
Mutual labels:  recyclerview
Recyclerviewpresenter
RecyclerView Adapter Library with different models and different layouts as convenient as possible.
Stars: ✭ 86 (-94.04%)
Mutual labels:  recyclerview
Banner
Android Viewpager rotation control, application guide page controls, support vertical, horizontal cycle scrolling, extended from view support animation, indicator extension and so on;Android viewpager轮播图控件、app引导页控件,支持垂直、水平循环滚动,扩展自viewpager 支持动画,指示器扩展等。
Stars: ✭ 96 (-93.34%)
Mutual labels:  recyclerview
Flexadapter
The easiest way to use a RecyclerView on Android
Stars: ✭ 80 (-94.45%)
Mutual labels:  recyclerview
Cartlayout
🦄 使用 RecyclerView 实现店铺分组购物车。 高仿京东购物车、高仿淘宝购物车、高仿天猫购物车
Stars: ✭ 101 (-93%)
Mutual labels:  recyclerview
Inifiniterecyclerview
Library for implementing endless loading list easily in Android applications
Stars: ✭ 79 (-94.52%)
Mutual labels:  recyclerview
Recyclerviewdemo
Demo showing the basics to advanced use cases of Android RecyclerView
Stars: ✭ 92 (-93.62%)
Mutual labels:  recyclerview
Expandablerecyclerview
Custom RecyclerView#Adapter that implement features like ExpandableListView
Stars: ✭ 107 (-92.58%)
Mutual labels:  recyclerview
Zoomrecyclerview
A Zoomable RecyclerView for comic
Stars: ✭ 102 (-92.93%)
Mutual labels:  recyclerview
Flowlayout
An Android Layout Manager to create a gridview with cells of different sizes inspired by Flow Layout for iOS.
Stars: ✭ 98 (-93.2%)
Mutual labels:  recyclerview

vue-recyclerview

npm

Mastering Large Lists with the vue-recyclerview

Feature

  • DOM recyleing
  • Multiple column
  • Waterflow

Preview

Demo

https://hilongjw.github.io/vue-recyclerview/

Requirements

Vue 2.0 +

Installation

Direct Download / CDN

https://unpkg.com/vue-recyclerview/dist/vue-recyclerview

unpkg.com provides NPM-based CDN links. The above link will always point to the latest release on NPM. You can also use a specific version/tag via URLs like https://unpkg.com/vue-recyclerview/dist/vue-recyclerview.js

Include vue-recyclerview after Vue and it will install itself automatically:

<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue-recyclerview/dist/vue-recyclerview.js"></script>

NPM

    $ npm install vue-recyclerview

When used with a module system, you must explicitly install the vue-recyclerview via Vue.use():

import Vue from 'vue'
import VueRecyclerviewNew from 'vue-recyclerview'

Vue.use(VueRecyclerviewNew)

You don't need to do this when using global script tags.

Dev Build

You will have to clone directly from GitHub and build vue-recyclerview yourself if you want to use the latest dev build.

$ git clone [email protected]:hilongjw/vue-recyclerview.git node_modules/vue-recyclerview
$ cd node_modules/vue-recyclerview
$ npm install
$ npm run build

Getting Started

We will be using ES2015 in the code samples in the guide.

main.js

// If using a module system (e.g. via vue-cli), import Vue and RecyclerView and then call Vue.use(RecyclerView).
// import Vue from 'vue'
// import RecyclerView from 'vue-recyclerview'
// import App from './App.vue'
// Vue.use(RecyclerView)

// Now the app has started!
new Vue({
  render: h => h(App)
}).$mount('#app')

App.vue

<template>
  <div id="app">
    <RecyclerView
      :prerender="30"
      style="height: calc(100vh - 50px)"
      :fetch="MiFetch" 
      :item="MiItem" 
      :tombstone="MiTomstone"
    ></RecyclerView>
  </div>
</template>

<script>
import MiItem from './MiItem.vue'
import MiTomstone from './MiTombstone.vue'
import MiFetch from './mi-fetch'

export default {
  name: 'app',
  data () {
    return {
      MiFetch,
      MiItem,
      MiTomstone
    }
  }
}
</script>

Full example code

Props Options

key description defualt type/options
fetch Data fetching function
list List data of RecyclerView []
prerender Number of items to instantiate beyond current view in the opposite direction. 20 Number
remain Number of items to instantiate beyond current view in the opposite direction. 10 Number
column Specifies how many columns the listings should be displayed in 1 Number
item The Vue component of RecyclerView's item Vue component
tombstone The Vue component of RecyclerView's tombstone Vue component
loading The loading component behind the RecyclerView pull-to-refresh built-in loading Vue component
options advanced options - Object
  • fetch:Function
function fetch (limit:Number, skip:Number) {
  return Promise.resolve({
    list: list // Array,
    count: count // Number
  })
}

  • list
[
// item
{
  vm: vm, // <Vue Instance>
  data: {
    name: 'test'
  },
  node: null,
  height: 100,
  width: 100,
  top: 0,
}, 
// tombstone
{
  vm: null
  data: null,
  node: null,
  height: 100,
  width: 100,
  top: 0,
}]
  • options
<RecyclerView 
ref="RecyclerView"
key="wechat"
class="recyclerview-container wechat" 
:fetch="wechatFetch" 
:item="ChatItem" 
:tombstone="Tombstone"
:prerender="10"
:remain="10"
:options="wechatOptions"
@inited="initScrollToBottom"
></RecyclerView>
data () {
  return {
    wechatOptions: {
      reuseVM: true,
      usePrefix: true,
      props: {
        color: {
          value: ''
        }
      }
    }
  }
}

default:

const options = {
  preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|IMG)$/ },
  distance: 50,
  animation_duration_ms: 200,
  tombstone_class: 'tombstone',
  invisible_class: 'invisible',
  prerender: 20,
  remain: 10,
  preventDefault: false,
  column: 1,
  waterflow: false,
  cacheVM: 0,
  reuseVM: false,
  usePrefix: false,
  props: {}
}

Instance Method

  • scrollToIndex
this.$refs.RecyclerView.scrollToIndex(100)

License

MIT

the project inspired by infinite-scroller

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].