@grafikri/vue-infinite-scroll

0.8.0 • Public • Published

DEMO & DOCS

vue infinite scroll demo

Install

  1. Install package
npm i @grafikri/vue-infinite-scroll
  1. Register it as vue plugin

Don't forget it register before create an Vue instance. here

import VueInfiniteScroll from "@grafikri/vue-infinite-scroll"
Vue.use(VueInfiniteScroll)
  1. Start to use it as directive in component
<template>
  <div v-infinite-scroll="{ onEnter, onLeave, distance: 100 }">
    This is my long content
  </div>
</template>

<script>
export default {
  name: "MyCustomComponent",
  methods: {
    onEnter() {
      // do something
    },
    onLeave() {
      // do something
    },
  },
}
</script>

Options

Properties

distance

The distance means space between view's and scroll's bottom positions. The value of distance is pixel.

Default: 200

Required: false

Methods

onEnter

The method when view's bottom appear.

Required: true on DOM

onLeave

The method when view's bottom leave.

Required: true on DOM

Package Sidebar

Install

npm i @grafikri/vue-infinite-scroll

Weekly Downloads

3

Version

0.8.0

License

ISC

Unpacked Size

3.35 kB

Total Files

6

Last publish

Collaborators

  • grafikri