vue分页插件的使用方法
前端  /  管理员 发布于 3年前   246
本文实例为大家分享了vue分页插件的具体代码,供大家参考,具体内容如下 分页插件代码: vue代码 使用说明: 直接拷贝即可使用,只需要修改总页数、当前页。 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
data: { current_page: result.resultObj.number + 1, //当前页 pages: result.resultObj.totalPages, //总页数 changePage: '',//跳转页 nowIndex: 0 }, computed: { show: function () { return this.pages && this.pages != 1 }, pstart: function () { return this.current_page == 1; }, pend: function () { return this.current_page == this.pages; }, efont: function () { if (this.pages <= 7) return false; return this.current_page > 5 }, ebehind: function () { if (this.pages <= 7) return false; var nowAy = this.indexs; return nowAy[nowAy.length - 1] != this.pages; }, indexs: function () { var left = 1, right = this.pages, ar = []; if (this.pages >= 7) { if (this.current_page > 5 && this.current_page < this.pages -4){ left = Number(this.current_page) - 3; right = Number(this.current_page) + 3; } else { if (this.current_page <= 5) { left = 1; right = 7; } else { right = this.pages; left = this.pages - 6; } } } while (left <= right) { ar.push(left); left++; } return ar; }, }, methods: { jumpPage: function (id) { if (id <= this.pages && id >= 1) { this.current_page = id; loadData(this.current_page - 1, size); } }, lessPage: function () { this.current_page--; loadData(this.current_page - 1, size); }, addPage: function () { this.current_page++; loadData(this.current_page - 1, size); }}
您可能感兴趣的文章:
博主 在
2023年国务院办公厅春节放假通知:1月21日起休7天中评论 @ xiaoB 你只管努力,剩下的叫给天意;天若有情天亦老,..xiaoB 在
2023年国务院办公厅春节放假通知:1月21日起休7天中评论 会不会春节放假后又阳一次?..BUG4 在
你翻墙过吗?国内使用vpn翻墙可能会被网警抓,你需了解的事中评论 不是吧?..博主 在
go语言+beego框架中获取get,post请求的所有参数中评论 @ t1 直接在router.go文件中配就ok..Jade 在
如何在MySQL查询中获得当月记录中评论 Dear zongscan.com team, We can skyroc..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号