mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(Pagination): allow using links for pagination buttons (#1682)
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
<UButton
|
||||
v-for="(page, index) of displayedPages"
|
||||
:key="`${page}-${index}`"
|
||||
:to="typeof page === 'number' ? to?.(page) : null"
|
||||
:size="size"
|
||||
:disabled="disabled"
|
||||
:label="`${page}`"
|
||||
@@ -69,6 +70,7 @@
|
||||
<script lang="ts">
|
||||
import { computed, toRef, defineComponent } from 'vue'
|
||||
import type { PropType } from 'vue'
|
||||
import type { RouteLocationRaw } from '#vue-router'
|
||||
import UButton from '../elements/Button.vue'
|
||||
import { useUI } from '../../composables/useUI'
|
||||
import { mergeConfig } from '../../utils'
|
||||
@@ -117,6 +119,10 @@ export default defineComponent({
|
||||
return Object.keys(buttonConfig.size).includes(value)
|
||||
}
|
||||
},
|
||||
to: {
|
||||
type: Function as PropType<(page: number) => RouteLocationRaw>,
|
||||
default: null
|
||||
},
|
||||
activeButton: {
|
||||
type: Object as PropType<Button>,
|
||||
default: () => config.default.activeButton as Button
|
||||
|
||||
Reference in New Issue
Block a user