Pagination New
New
分页允许您在多个页面上将大量内容划分为较小的块。
Usage
to
to
<template>
<div>
<PlPagination ref="paginations" :count="count1" mode="ghost" shape="circle" />
<br>
<PlPagination ref="paginations" :count="count2" mode="outline" />
<br>
<pl-button-group size="mini" mode="outline">
<pl-button @click="handlePrevClick">
prev
</pl-button>
<pl-button @click="handleNextClick">
next
</pl-button>
<pl-button @click="handleToggleClick">
toggle
</pl-button>
<pl-button @click="handleAddClick">
add step
</pl-button>
<pl-button @click="handleSubClick">
sub step
</pl-button>
</pl-button-group>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { PaginationInstance } from 'play-ui'
const count1 = ref(8)
const count2 = ref(10)
const paginations = ref<PaginationInstance>()
const handlePrevClick = () => {
paginations.value?.prev()
}
const handleNextClick = () => {
paginations.value?.next()
}
const handleToggleClick = () => {
paginations.value?.toggle(2)
}
const handleAddClick = () => {
count1.value++
}
const handleSubClick = () => {
count1.value--
}
</script>
<template>
<div>
<PlPagination ref="paginations" :count="count1" mode="ghost" shape="circle" />
<br>
<PlPagination ref="paginations" :count="count2" mode="outline" />
<br>
<pl-button-group size="mini" mode="outline">
<pl-button @click="handlePrevClick">
prev
</pl-button>
<pl-button @click="handleNextClick">
next
</pl-button>
<pl-button @click="handleToggleClick">
toggle
</pl-button>
<pl-button @click="handleAddClick">
add step
</pl-button>
<pl-button @click="handleSubClick">
sub step
</pl-button>
</pl-button-group>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { PaginationInstance } from 'play-ui'
const count1 = ref(8)
const count2 = ref(10)
const paginations = ref<PaginationInstance>()
const handlePrevClick = () => {
paginations.value?.prev()
}
const handleNextClick = () => {
paginations.value?.next()
}
const handleToggleClick = () => {
paginations.value?.toggle(2)
}
const handleAddClick = () => {
count1.value++
}
const handleSubClick = () => {
count1.value--
}
</script>
Props
Name | Type | Default | Description |
---|---|---|---|
mode | 'solid' | 'white' | 'outline' | 'ghost' | 'link' | 'ghost' | 分页器风格。 |
shape | 'rounded' | 'pilled' | 'circle' | 'plain' | 'rounded' | 分页器按钮形状。 |
count | number | 0 | 分页器总页数。 |
showCount | number | 7 | 分页器展示页数。 |