Skip to content
On this page

基本使用

通过 v-model 绑定活跃的 index ,通过 list 传入需要显示的子项列表

html
<uv-pagination v-model="activeIndex" @change="change" :total="100"/>

替换翻页按钮

通过 prevText 设置上一页,通过 nextText 设置下一页,也可以使用插槽 prev 自定义上一页,通过 next 自定义下一页

html
<uv-pagination v-model="activeIndex"  prev-text="上一页" next-text="下一页" :total="100"/>

props

属性含义类型默认值
pageSize每页显示条数Number10
modelValue双向绑定的页数Number1
total总数Number0
prevText替代图标上一页文字String-
nextText替代图标下一页文字String-
disabledColor无法点击时的文字颜色String'#bbbec4'
defaultColor默认文字颜色String'#606266'

events

事件名称含义参数
change页数改变时当前的index

css变量

css
--uv-pagination-font-size: 14px;
  --uv-pagination-content-item-size: 34px;
  --uv-pagination-content-item-color: #606266;
  --uv-pagination-content-item-gap: 8px;
  --uv-pagination-content-item-border-radius: 2px;
  --uv-pagination-content-item-active-color: #ffffff;
  --uv-pagination-content-item-bg-color: #f0f2f5;
  --uv-pagination-content-item-acitve-bg-color: #409eff;
  --uv-pagination-disabled-color: #bbbec4;
  --uv-pagination-text-padding: 0 5px;

Released under the MIT License.