JSPM

@grafikri/vue-infinite-scroll

0.8.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q34606F
  • License ISC

Infitine scroll for vue

Package Exports

  • @grafikri/vue-infinite-scroll

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@grafikri/vue-infinite-scroll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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