Skip to content

Pagination Page

A pagination component for navigating between pages. Simple and straightforward.

Basic Usage

Simply insert content using the component's default slot.

  • 1
  • 2
  • 3
  • 4
  • 10
<template>
  <b-page v-model:current="current" :total="100"></b-page>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const current = ref(2)
</script>

Page Size

  • 1
  • 2
  • 3
  • 4
  • 10
<template>
  <b-page v-model:current="current" :total="100" show-sizer></b-page>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const current = ref(2)
</script>

Elevator

  • 1
  • 2
  • 3
  • 4
  • 10
  • 跳至
<template>
  <b-page v-model:current="current" :total="100" show-elevator></b-page>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const current = ref(2)
</script>

Total

  • 共 100 条
  • 1
  • 2
  • 3
  • 4
  • 10
<template>
  <b-page v-model:current="current" :total="100" show-total></b-page>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const current = ref(2)
</script>

Mini Size

  • 共 100 条
  • 1
  • 2
  • 3
  • 4
  • 10
  • 跳至
<template>
  <b-page
    v-model:current="current"
    :total="100"
    size="small"
    show-elevator
    show-sizer
    show-total
  ></b-page>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const current = ref(2)
</script>

Previous/Next Page Text

  • Prev
  • 1
  • 2
  • 3
  • 4
  • 10
  • Next
<template>
  <b-page v-model:current="current" :total="100" prev-text="Prev" next-text="Next"></b-page>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const current = ref(2)
</script>

Simple Mode

  • / 10
<template>
  <b-page v-model:current="current" :total="100" simple></b-page>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const current = ref(2)
</script>

Props

ParameterDescriptionTypeOptionsDefault
currentCurrent page number, supports v-model:current modifierNumber1
totalTotal number of itemsNumber0
page-sizeNumber of items per pageNumber10
page-size-optsConfiguration for page size switchingArray[10, 20, 30, 40]
placementExpansion direction of the page size switching dropdownstringbottom / topbottom
sizeSize, options are small (mini) or none (default)string
simpleSimple modeBooleanfalse
show-totalShow total countBooleanfalse
show-elevatorShow elevator for quickly jumping to a specific pageBooleanfalse
show-sizerShow page sizer to change page-sizeBooleanfalse
class-nameCustom class nameString
stylesCustom inline stylesObject
prev-textText for the previous page button, replacing the iconString
next-textText for the next page button, replacing the iconString

Events

Event NameDescriptionReturn Value
changeCallback when page number changes, returns the new page numberpage number
size-changeCallback when page size changes, returns the new page sizepage-size

Slot

NameDescription
defaultCustom content for displaying the total count