Skip to content

Pagination ​

Pagination splits large datasets across multiple pages, with smart ellipsis collapsing, multiple variant styles, and sizes.

Basic Usage ​

Bind the current page with v-model and specify the total page count via total.

vue
<TPagination v-model="page" :total="10" />

Smart Collapse ​

When there are many pages, the component automatically collapses into ellipsis gaps. boundary controls how many pages are pinned at each end, and around controls how many pages appear next to the current page.

boundary="1" around="1" (default) ​

vue
<TPagination v-model="page" :total="20" />

boundary="2" around="2" ​

vue
<TPagination v-model="page" :total="20" boundary="2" around="2" />

Show First / Last Buttons ​

Set show-first-last to show "First" and "Last" buttons. By default they use IconChevronLeftPipe / IconChevronRightPipe.

vue
<TPagination v-model="page" :total="12" show-first-last />

You can also use first-text and last-text for textual labels.

vue
<TPagination v-model="page" :total="12" show-first-last first-text="First" last-text="Last" />

Text Labels ​

Customize the previous / next step text via prev-text and next-text.

vue
<TPagination v-model="page" :total="12" prev-text="Prev" next-text="Next" />

Data Count Mode ​

Use total-items with page-size to calculate the total number of pages automatically.

vue
<TPagination v-model="page" :total-items="95" :page-size="10" />

Variants ​

Outline ​

vue
<TPagination v-model="page" :total="8" variant="outline" />

Circle ​

vue
<TPagination v-model="page" :total="8" variant="circle" />

Sizes ​

Small (sm) ​

vue
<TPagination v-model="page" :total="8" size="sm" />

Large (lg) ​

vue
<TPagination v-model="page" :total="8" size="lg" />

Disabled State ​

Set disabled to disable all interactions.

vue
<TPagination v-model="page" :total="10" disabled />

Jump To Page ​

Enter a page number in the input box and press Enter (or click the "Go" button) to jump directly.

The jump prop defaults to undefined — the input box auto-appears when the total page count exceeds 20. Pass true to force-show or false to force-hide.

Auto-show (total > 20) ​

vue
<TPagination v-model="page" :total="30" />

Force-hide ​

vue
<TPagination v-model="page" :total="100" :jump="false" />

API ​

Props ​

PropDescriptionTypeDefault
v-modelCurrent page numbernumber1
totalTotal page countnumber—
total-itemsTotal number of items (used with page-size)number—
page-sizeItems per pagenumber10
boundaryPages pinned at start / endnumber1
aroundPages shown around the current pagenumber1
show-first-lastShow first / last page buttonsbooleanfalse
prev-textPrevious button text (shows an icon when omitted)string—
next-textNext button text (shows an icon when omitted)string—
first-textFirst page button text (shows an icon when omitted)string—
last-textLast page button text (shows an icon when omitted)string—
variantVisual variant'default' | 'outline' | 'circle''default'
sizeButton size'sm' | 'lg'—
disabledGlobal disabled statebooleanfalse
jumpJump input: undefined = auto-show when > 20 pages, true = force-show, false = force-hideboolean | undefinedundefined
jump-textJump button text (i18n friendly)string'跳转'
jump-placeholderJump input placeholder (i18n friendly)string'页码'

Emits ​

EmitDescriptionParameters
changeFires when the page changes(page: number)

Slots ​

Not applicable (purely array-driven rendering).