anx-common
v1.1.7
Published
anx-common
Downloads
2
Readme
anx-common
##Install
npm install anx-common -S
#Use
#main.js "``` import Vue from 'vue' import {pagination} from 'anx-common'
Vue.use(pagination)
##页面:
"``` vue
<pagination
:total="total"
:pageSize.sync="form.pageSize"
:page.sync="form.page"
@pagination="changeSize"
:layout.sync=""
:refresh="true"
/>
```"
##js:
"``` js
changeSize(obj) {
let val = {
pageNo: obj.page,
pageSize: obj.pageSize,
...
};
this.form = { ...this.params, ...val };
//调用查询方法
},
```"
##详细参数:
"``` js
total: { //总条数
required: true,
type: Number
},
pageSize: { 每页条数
type: Number,
default: 20
},
page: { //当前页
type: Number,
default: 1
},
refresh: { 是否带刷新按钮
type: Boolean
},
pageSizes: { //设置每页条数的框
type: Array,
default() {
return [10, 20, 30, 50];
}
},
layout: {
type: String,
default: "total, sizes, prev, pager, next, jumper"
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
}
```"