Vue-infinite-loading

Guide

Installation

NPM

If you are building a large application, we recommend you use the following method:

npm install vue-infinite-loading -S

Direct <script> Include

After you import this plugin through the script tag, it will register the InfiniteLoading component automatically, so you can use it in the global scope.

CDN

You can import this plugin from unpkg:

<script src="https://unpkg.com/vue-infinite-loading@^2/dist/vue-infinite-loading.js"></script>

Manual

You can also download and import it manually:

Download

Import

Component

You can import it as a custom component:

<template>
  <infinite-loading></infinite-loading>
</template>

<script>
import InfiniteLoading from 'vue-infinite-loading';

export default {
  components: {
    InfiniteLoading,
  },
};
</script>

Plugin API

If you want to configure default options, you can register this plugin through the use API of Vue.js:

// main.js or index.js
import InfiniteLoading from 'vue-infinite-loading';

Vue.use(InfiniteLoading, { /* options */ });

If you use the plugin API, the InfiniteLoading component will be registered as a global component just like when including it with the script tag, but you won't need to re-register it through the components property in your own components.

Last Updated: 1/12/2019, 2:11:54 PM

An infinite scroll plugin for Vue.js

EN | 中文