vue-page-utils
v1.0.1
Published
vue分页插件
Downloads
5
Readme
vue-page-decorator插件使用说明
@PageOption作用在class上
PageOption(option) option将注入到state里面,option格式(默认不传则传入如下参数)为如下:
{ // 每页数量 pageSizes: [10, 20, 30, 50, 100], // 当前页取值key currentKey: 'current', // 当前页数量取值key sizeKey: 'size', // 总页数取值key totalKey: 'total', // 查询数据取值key recordsKey: 'recordsKey', // element-ui配置 layout: 'total, sizes, prev, pager, next, jumper', }
使用此注解会在组件实例上注入reset,search,addPage,updataRecord,pageChange,sizeChange方法
resetFields
:配合element-ui框架,调用表单Form的重置方法,参数为form的ref名search
:若组件实现了getData方法,则调用表单将页码重置为第一页,调用getData方法addPage
:传入一个对象,将当前分页的页码(current)和当前页的数量(pageSize)merge到传入的对象上,返回merge后的对象。updataRecord
:参数有两个,第一个为接口返回的数据(本插件默认后台格式如下),第二个参数为待跟新的状态名称。pageChange
:页码数变化后,更新分页配置并调用getData方法更新数据sizeChange
:每页展示条数变化后,更新分页配置并调用getData方法更新数据getPageOption
:此方法直接返回分页配置paginationAttr
:此方法直接返回element-ui分页配置属性paginationEvent
:此方法直接返回element-ui分页配置事件
欢迎提出各种bug,有问题可以直接发送邮件到 [email protected]
[-]