v-pc-pagination

A vue pagination component for pc.

Usage no npm install needed!

<script type="module">
  import vPcPagination from 'https://cdn.skypack.dev/v-pc-pagination';
</script>

README

vue-pagination

GitHub Github file size npm node.js

基于 Vue 的PC端分页组件

How to use

npm i -S v-pc-pagination

Global regisiter

import Vue from 'vue'
import VuePagination from 'v-pc-pagination'
Vue.use(VuePagination)

OR in component

import VuePagination from 'v-pc-pagination'

// in vue component

export default {
  components: { VuePagination },
  methods: {
      pageChange (page) {
        console.log(page);
      }
  }
}
<vue-pagination :total="total" @change="pageChange"></vue-pagination>

Props

name type desc default
total Number Total page number required
current Number Current page number 1
show Number Display Page number: odd number and >= 5 5

Event

name params desc
@change index The page index which user clicked