1.1.1 • Published 5 years ago

pagination-vue-simple v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

pagination-vue-simple

一个简单的原生自定义vue分页插件。

1.1.0 版本更新说明:

1.新增自定义页码被激活颜色theme-color的功能,并兼容ie9及其以上 2.对属性说明部分参数写法进行修正,使其与完整示例里的写法一致 3.新增效果图展示

安装

npm install pagination-vue-simple --save

初始化 在main.js中全局引入

import Vue from 'vue'
import PaginationVueSimple from 'pagination-vue-simple'

Vue.use(PaginationVueSimple)

最简示例

<template>
  <div id="app">
    <pagination-vue-simple 
        :total="80" 
        @current-change-page="getPage">
    </pagination-vue-simple>
  </div>
</template>
<script>
export default {
  name: 'app',
  data(){
    return {
      page: 1
    }
  },
  methods:{
    getPage(page){
      this.page = page
    }
  }
}
</script>

完整示例

<template>
  <div id="app">
    <pagination-vue-simple 
        :type="'sm'" 
        :total="80" 
        :limit="10" 
        :max-show="5" 
        :is-show-total-page="false" 
        :p-position="'left'"
        :theme-color="'green'"
        @current-change-page="getPage">
    </pagination-vue-simple>
  </div>
</template>
<script>
export default {
  name: 'app',
  data(){
    return {
      page: 1
    }
  },
  methods:{
    getPage(page){
      this.page = page
    }
  }
}
</script>

属性

参数说明类型可选值默认值
total数据总条数Number
limit每页数据条数Number10
max-show最多显示页码数Number5
type页码样式大小类型Stringnormal/sm/lgnormal
is-show-total-page是否显示总页码Booleantrue/falsefalse
theme-color主题颜色,被选中时的颜色String#36af6c
p-position页面放置位置Stringleft/center/rightleft

事件

事件名称说明回调参数
current-change-page切换页码时会触发当前页 page
1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago