Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.19 KB

README.md

File metadata and controls

69 lines (45 loc) · 1.19 KB

vue-pagination

A pagination components for vue

NOTE: This component is just for vue 2+. Please check your Vue version first.

Demo

This project is a runtime demo. You can get the demo by these command:

git clone https://github.com/shangxinbo/vue-pagination.git yourPath
cd yourPath
npm install 
npm run dev  // serve with hot reload at http://localhost:8080 to see the demo 

If you want to build production with minification. you can do this:

npm run build

Use

It's a single-file component for Vue.You should use it with webpack,babel and vue-loader to run.So I assume that you have node v4+ and npm v3+

npm install --save shangxinbo/vue-pagination

then in your component,you can use it by this:

import pages from 'vue-pagination'
export default {
    
    components:{
        pages
    }
    
}

Docs

Props

  • total

    type: Number

    desc: required is true, the max number of pages

    e.g. : 123

  • current

    type: Number

    desc: required is true, the current page

    e.g.:23

Events

  • jump(num)

    triggler: clicke the page button or prev/next button

    num : return the num going to