Coder Social home page Coder Social logo

vue-pagination's Introduction

vue-pagination

之前一直用layerPage做分页插件的 但是转vue后用layer总感觉怪怪的,所以仿照layer写了个vue组件 使用方法:

js
import pagination from '../../components/vue-pagination' //引入分页组件
export default {
    components: {
      pagination,    //注册组件
    },
    data() {
       return {
          total: 30,     // 记录总条数   默认空,如果小于pageNum则组件不显示   类型Number
          pageNum: 10,    // 每页显示条数,默认10                              类型Number
          current: 1,     // 当前页数,   默认为1                             类型Number
          pagegroup:5     // 分页条数     默认为5,需传入奇数                  类型Number
          skin:'#16a086'  // 选中页码的颜色主题 默认为'#16a086'                类型String
         }
    },
     methods:{
        pagechange:function(current){     // 页码改变传入新的页码,此处做回调
           console.log(current);
        }
    }
}

html

<pagination 
    :total="total" 
    :current="current" 
    :skin="skin" 
    :pagenum="pageNum" 
    :pagegroup="pagegroup" 
    @change="pagechange"
    ></pagination>

默认样式如下 avatar

vue-pagination's People

Contributors

fengjiel avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.