Skip to content

Pagination 分页器

用于数据翻页的控件,支持移动端轻量模式 (mode="simple")、多数字页码模式 (mode="multi") 与轮播圆点模式 (mode="pointer")。


代码示例

1. 移动端轻量模式 (Simple)

vue
<template>
  <mu-pagination v-model="current" :total="100" mode="simple" @change="onChange" />
</template>

<script setup>
import { ref } from 'vue'

const current = ref(1)
const onChange = ({ current }) => console.log('当前页:', current)
</script>

2. 多数字页码模式 (Multi)

vue
<template>
  <mu-pagination v-model="current" :total="120" mode="multi" />
</template>

API 属性说明 (Props)

参数名说明类型可选值默认值
v-model / current / modelValue当前页码Number-1
total总条目数量Number-0
pageSize每页展示条数Number-10
pageCount直接指定总页数 (优先级高于 total)Number-0
maxPages多数字模式展示的最大页码根数Number-5
mode分页展现形态Stringmulti | simple | pointer'multi'
shape页码按鈕形状Stringround | square'round'
prevText上一页按鈕文案String-'上一页'
nextText下一页按鈕文案String-'下一页'

事件说明 (Events)

事件名说明回调参数
change改变页码时触发({ current: Number, totalPage: Number })
update:modelValue / update:currentv-model 双向绑定更新(current: Number)

基于 MIT 协议开源发行

H5 模拟器 (pagination)☀️🔄