Pagination Bar
Displays data in paged format and provides navigation between pages.
Usage
vue
<script setup lang="ts">
import { ref } from 'vue';
import { PaginationBar } from '@youcan/ui-vue3';
const TOTAL = 50;
const PER_PAGE = 5;
const TOTAL_PAGES = Math.ceil(TOTAL / PER_PAGE);
const currentPage = ref(1);
function handlePaginationNavigation(pageNumber: number) {
currentPage.value = pageNumber;
}
</script>
<template>
<PaginationBar
:current="currentPage"
:size="TOTAL_PAGES"
:count="PER_PAGE"
:total="TOTAL"
@update:current="handlePaginationNavigation"
/>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24