1 |
- import{u as a}from"./index.1f84bfe1.js";import{d as o,c as i,a6 as l}from"./vendor.9f3c6e4d.js";const d="_hidden_1x1u9_28";var n={"pagination-container":"_pagination-container_1x1u9_1",hidden:d},u=o({name:"pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:10},pageSizes:{type:Array,default:[5,10,20,30,50]},layout:{type:String,default:"total, sizes, prev, pager, next"},showMuitiple:{type:Number,default:10},hideOnSinglePage:{type:Boolean,default:!0},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1},sync:{type:Boolean,default:!1},saveKey:{type:String,default:""},pagination:{type:Function,default:()=>{}}},methods:{handleSizeChange(e){if(this.$emit("update:page",1),this.$emit("update:limit",e),this.pagination(),this.autoScroll){const t=document.documentElement.scrollTop||document.body.scrollTop;a(t,0)}},handleCurrentChange(e){if(this.$emit("update:page",e),this.$emit("update:limit",this.limit),this.pagination(),this.autoScroll){const t=document.documentElement.scrollTop||document.body.scrollTop;a(t,0)}}},render(){return i("div",{class:[n["pagination-container"],this.hidden&&n.hidden]},[i(l,{currentPage:this.page,pageSize:this.limit,"onUpdate:currentPage":e=>{},"onUpdate:pageSize":e=>{this.handleSizeChange(e)},pageSizes:this.pageSizes,total:this.total,hideOnSinglePage:this.total>this.showMuitiple?!1:this.hideOnSinglePage,background:this.background,layout:this.layout,"onSise-change":this.handleSizeChange,"onCurrent-change":this.handleCurrentChange},null)])}});export{u as P};
|