1.0.0 • Published 6 years ago

vue-pagination-mini v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

vue-pagination-mini

Installation

npm install --save vue-pagination-mini

Example

<template>
  <div id="app">
    <vue-pagination
      :total="55"
      :page-size="13"
      :current-page="1"
      :show-total="true"
      :show-sizes="true"
      :show-jump="true"
      @current-change="currentChange"
      @size-change="sizeChange">
    </vue-pagination>
  </div>
</template>

<script>
import VuePagination from '../dist/vue-pagination.min.js'

export default {
  name: 'App',
  components: {
    VuePagination
  },
  methods: {
    currentChange (val) {
      console.log(`current page is ${val}`);
      console.log(`当前页 ${val}`);
    },
    sizeChange (val) {
      console.log(`pageSize is ${val}`);
      console.log(`每页的大小 ${val}`);
    }
  }
}
</script>

Props

NameTypeDefaultoptionalDescription
totalNumber1The total number of data (required)
pageSizeNumber10The number of bars displayed per page (required)
currentPageNumber1Current page (required)
showTotalBooleanfalseDisplays the attributes of the total number
showSizesBooleanfalseDisplays properties that change the size of each page
showJumpBooleanfalseDisplays the properties of the current page jump
preTextStringThe text inside the front page button
nextTextBooleanfalseThe text inside the back page button
stepNumber5Quick page turning step
colorString#428bcaTheme colors
sizeStringsmallsmall/middle/largeComponent size
pageSizesArray10, 20, 30, 50The number of optional values per page.

Events

NameCallbackDescription
size-changeSize per pagePageSize is triggered when it changes.
current-changeThe current page currentPageThe currentPage change will trigger.

Props

名称类型默认值可选值描述
totalNumber1数据总数 (必填)
pageSizeNumber10每页显示的数量 (必填)
currentPageNumber1当前的页数 (必填)
showTotalBooleanfalse显示总数的属性
showSizesBooleanfalse显示每页大小的属性
showJumpBooleanfalse显示跳转的属性
preTextString向前翻页按钮内的文本
nextTextBooleanfalse向后翻页按钮内的文本
stepNumber5快速翻页的步长
colorString#428bca主题颜色
sizeStringsmallsmall/middle/large组件的尺寸大小
pageSizesArray10, 20, 30, 50每页显示个数选择器的选项设置

Events

NameCallbackDescription
size-change每页条数sizepageSize 改变时会触发
current-change当前页currentPagecurrentPage 改变时会触发