vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
2 lines (1 loc) • 1.93 kB
JavaScript
"use strict";const e=require("vue"),k=require("./hook/usePagination.cjs"),u=require("@vuux/icons"),p=["onClick"],B=e.defineComponent({name:"Pagination",__name:"index",props:{total:{default:0},pageSize:{default:10},pageNum:{default:1},background:{type:Boolean},hide:{type:Boolean},morePageCount:{default:2}},emits:["change"],setup(s,{emit:f}){const l=s,m=f,{currentMorePageCount:a,currentNum:o,totalPages:c,isHide:d,pages:i,handlePage:r}=k.usePagination(l,m);return(C,n)=>e.unref(d)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["app-pagination",{"is-background":l.background}])},[e.createElementVNode("ul",null,[e.unref(o)>1?(e.openBlock(),e.createElementBlock("li",{key:0,onClick:n[0]||(n[0]=e.withModifiers(t=>e.unref(r)(e.unref(o)-1),["prevent"]))},[e.createVNode(e.unref(u.Icon),{name:"Icon3498333"})])):e.createCommentVNode("",!0),e.unref(i)[1]>2?(e.openBlock(),e.createElementBlock("li",{key:1,onClick:n[1]||(n[1]=e.withModifiers(t=>e.unref(r)(e.unref(o)-e.unref(a)),["prevent"]))},[e.createVNode(e.unref(u.Icon),{name:"Icon1483701"})])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),t=>(e.openBlock(),e.createElementBlock("li",{key:t,class:e.normalizeClass({"is-active":t===e.unref(o)}),onClick:e.withModifiers(g=>e.unref(r)(t),["prevent"])},e.toDisplayString(t),11,p))),128)),e.unref(i)[e.unref(i).length-2]<e.unref(c)-1?(e.openBlock(),e.createElementBlock("li",{key:2,onClick:n[2]||(n[2]=e.withModifiers(t=>e.unref(r)(e.unref(o)+e.unref(a)),["prevent"]))},[e.createVNode(e.unref(u.Icon),{name:"Icon1483701"})])):e.createCommentVNode("",!0),e.unref(o)<e.unref(c)?(e.openBlock(),e.createElementBlock("li",{key:3,onClick:n[3]||(n[3]=e.withModifiers(t=>e.unref(r)(e.unref(o)+1),["prevent"]))},[e.createVNode(e.unref(u.Icon),{name:"Icon6657361"})])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}});module.exports=B;