diff --git a/Web/src/components/Abutton.vue b/Web/src/components/Abutton.vue
index fbb06c8..224355b 100644
--- a/Web/src/components/Abutton.vue
+++ b/Web/src/components/Abutton.vue
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
+
+
+
+
diff --git a/Web/src/components/Pagination.vue b/Web/src/components/Pagination.vue
index 8845e01..133b617 100644
--- a/Web/src/components/Pagination.vue
+++ b/Web/src/components/Pagination.vue
@@ -2,17 +2,17 @@
@@ -28,75 +28,61 @@ const props = withDefaults(defineProps(), {
totalPages: 1,
});
-const emit = defineEmits<{
- (e: 'pageChange', page: number): void;
-}>();
+let currentPage = ref(props.currentPage)
+let totalPages = ref(props.totalPages)
-const inputPage = ref(props.currentPage);
+const emit = defineEmits(['pageChange'])
-watch(() => props.currentPage, (newVal: number) => {
- inputPage.value = newVal;
-});
-const goFirst = (): void => {
- if (props.currentPage > 1) {
- emit('pageChange', 1);
+const changePage = (type: any) => {
+ if (type == 'input' && currentPage.value < 1) {
+ currentPage.value = 1
+ }
+ if (type == 'input' && currentPage.value > totalPages.value) {
+ currentPage.value = totalPages.value
}
-};
-const goPrev = (): void => {
- if (props.currentPage > 1) {
- emit('pageChange', props.currentPage - 1);
+ if (type == 'prev' && currentPage.value == 1) {
+ return
+ }
+ if (type == 'next' && currentPage.value == totalPages.value) {
+ return
}
-};
-const goNext = (): void => {
- if (props.currentPage < props.totalPages) {
- emit('pageChange', props.currentPage + 1);
- }
-};
-const goLast = (): void => {
- if (props.currentPage < props.totalPages) {
- emit('pageChange', props.totalPages);
+ if (type == 'first') {
+ currentPage.value = 1
+ } else if (type == 'prev') {
+ currentPage.value--
+ } else if (type == 'next') {
+ currentPage.value++
+ } else if (type == 'last') {
+ currentPage.value = totalPages.value
}
-};
+ emit('pageChange', currentPage.value)
+}
+
-const goToPage = (): void => {
- let page: number = inputPage.value;
- if (isNaN(page) || page < 1) {
- page = 1;
- } else if (page > props.totalPages) {
- page = props.totalPages;
- }
- if (page !== props.currentPage) {
- emit('pageChange', page);
- }
- inputPage.value = page;
-};