1
1
# Pagination Navigation
2
2
3
- > Quick first, previous, next, last, and page buttons for pagination based navigation , supporting
3
+ > Quick first, previous, next, last, and page buttons for navigation based pagination , supporting
4
4
regular links or router links.
5
5
6
+ ` <b-pagination-nav> ` is used for navigating to new page URLs. For controlling in page component
7
+ pagination (such as table or list pagination), use the [ ` <b-pagination> ` ] ( /docs/components/pagination )
8
+ component instead.
9
+
6
10
``` html
7
11
<template >
8
12
<div >
@@ -86,7 +90,7 @@ buttons. You can override this behaviour by supplying a function reference to
86
90
the ` page-gen ` property. The function reference should accept a single argument
87
91
which is a page number (1-N). The ` page-gen ` function should return a string.
88
92
89
- Note HTML strings are currently not supported.
93
+ ** Note: ** HTML content in generated page number strings is ** not** supported.
90
94
91
95
** Example: Using an array of links to generate pagination:**
92
96
@@ -131,6 +135,7 @@ export default {
131
135
132
136
<!-- pagination-nav-links.vue -->
133
137
```
138
+
134
139
## Button Size
135
140
Optionally change from the default button size by setting the ` size `
136
141
prop to eiter ` 'am ` for smaller buttons or ` 'lg' ` for larger buttons.
@@ -162,6 +167,7 @@ export default {
162
167
<!-- pagination-size.vue -->
163
168
```
164
169
170
+
165
171
## Customizing
166
172
167
173
` <b-pagination-nav> ` supports several props that allow you to customize the appearance.
@@ -170,18 +176,27 @@ export default {
170
176
| ---- | -----------
171
177
| ` limit ` | Limit the maximum number of displayed page buttons (including ellipsis if present, and excluding first/prev/next/last buttons)
172
178
| ` number-of-pages ` | The total number of pages
179
+ | ` hide-ellipsis ` | never show ellipsis indicators
180
+ | ` hide-goto-end-buttons ` | never display goto first/last buttons
181
+
182
+ And provides several props for setting the content of the bookend buttons:
183
+
184
+ | Prop | Description
185
+ | ---- | -----------
173
186
| ` first-text ` | The "goto first page" button text (plain html supported)
174
187
| ` prev-text ` | The "goto previous page" button text (plain html supported)
175
188
| ` next-text ` | The "goto next page" button text (plain html supported)
176
189
| ` last-text ` | The "goto last page" button text (plain html supported)
177
190
| ` ellipsis-text ` | the ` ... ` indicator text (plain html supported)
178
- | ` hide-ellipsis ` | never show ellipsis indicators
179
- | ` hide-goto-end-buttons ` | never display goto first/last buttons
180
191
181
192
Ellipsis indicator(s) will only be ever shown at the front and/or end of
182
193
the page number buttons. For ` limit ` values less than or equal to ` 3 ` , the ellipsis
183
194
indicator(s) will never be shown for practical display reasons.
184
195
196
+ ** Note:** HTML is supported via the bookend content props. If allowing user supplied content
197
+ to populate these props, you should use named slots (see below) instead to avoid possible XSS attacks.
198
+
199
+
185
200
### Named slots
186
201
187
202
` <b-pagination-nav> ` supports several slots that allow you to customize the appearance.
@@ -194,6 +209,7 @@ indicator(s) will never be shown for practical display reasons.
194
209
| ` last-text ` | The "goto last page" button text (html/sub-components supported)
195
210
| ` ellipsis-text ` | the ` ... ` indicator text (html/sub-components supported)
196
211
212
+
197
213
## Alignment
198
214
199
215
By default the pagination component is left aligned. Change the alignment to
@@ -274,7 +290,7 @@ list, respectively, and <kbd>ENTER</kbd> or <kbd>SPACE</kbd> keys will select (c
274
290
## See also
275
291
276
292
For pagination control of a component (such as ` <b-table> ` ), use the
277
- [ ` <b-pagination> ` ] ( . /pagination) component instead.
293
+ [ ` <b-pagination> ` ] ( /docs/components /pagination) component instead.
278
294
279
295
280
296
<!-- Component reference added automatically from component package.json -->
0 commit comments