0.1.7 โ€ข Published 5 years ago

vue3-longlist v0.1.7

Weekly downloads
18
License
MIT
Repository
github
Last release
5 years ago

vue3-longlist

npm version

A vue3.x long list render plugin.

๐Ÿฆพ Type Strong: Written in Typescript

๐Ÿ“Ž Installation

$ npm i vue3-longlist

๐Ÿ‘ฝ Usage

main.ts

import { createApp } from "vue";
import App from "./App.vue";
import llist from "vue3-longlist";

createApp(App)
  .use(llist)
  .mount("#app");

App.vue

<template>
    <llist :list="your long list">
</template>

๐Ÿ“ Options

keydescriptiondefaulttype
listThe long list you want to render-array
itemHeightv-for item height (px)18number
scrollDownSlide how much triggers loading8number

๐Ÿ˜ƒ Example

<llist :list="aab">
  <template v-slot:default="scope">
    <div>
      <!-- index is v-for index๏ผŒ item is v-for item -->
      {{scope.index}},{{scope.item + 1 }}
    </div>
  </template>
</llist>
  aab: Array<number> = []

  aa() {
    for (let index = 0; index < 100000; index++) {
      this.aab.push(index)
    }
  }

  created(){
    this.aa()
  }
0.1.7

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.0

5 years ago