JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 313
  • Score
    100M100P100Q76942F

Vue.js pagination component

Package Exports

  • v-pagination

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 (v-pagination) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Vue Pagination

Simple, generic and non-intrusive pagination component for Vue.js. Presentation is based on bootstrap.

Dependencies

  • Vue.js (>=1.0). Required.
  • Bootstrap (CSS). Optional.

Installation

Option 1

Compile the code using browserify with the stringify transform

npm install vue-pagination

Require the script:

var VuePagination = require('vue-pagination');

Option 2

Import the compiled standalone file into your HTML, which will expose a global VueTables variable.

Usage

LIVE DEMO

Register the component(s)

Vue.use(VuePagination)

HTML:

<pagination for="some-entity" :records="500"></pagination>

props:

  • for string required unique identifier for the component instance.
  • records number required number of records
  • per-page number optional records per page. Default: 25
  • chunk number optional max pages per chunk. Default: 10
  • count-text string optional total records text. Default: '{count} records'

When a page is selected an event will be dispatched, using the unique id for the component. Listen to it and respond accordingly:

  this.$on('vue-pagination::some-entity', function(page) {
      // display the relevant records using the page param
  });