Skip to content

Commit

Permalink
fix(@vben/common-ui): pagination current page error (#4893)
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzyy authored Nov 14, 2024
1 parent 86e52ce commit 3bd5ef4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const emit = defineEmits<{
const refTrigger = useTemplateRef<HTMLElement>('refTrigger');
const currentSelect = ref('');
const currentList = ref(props.icons);
const currentPage = ref(1);
watch(
() => props.icons,
Expand Down Expand Up @@ -72,6 +73,7 @@ const handleClick = (icon: string) => {
};
const handlePageChange = (page: number) => {
currentPage.value = page;
setCurrentPage(page);
};
Expand Down Expand Up @@ -114,7 +116,6 @@ defineExpose({ changeOpenState });
class="flex-center flex justify-end overflow-hidden border-t py-2 pr-3"
>
<Pagination
v-slot="{ page }"
:items-per-page="36"
:sibling-count="1"
:total="total"
Expand All @@ -136,7 +137,7 @@ defineExpose({ changeOpenState });
as-child
>
<Button
:variant="item.value === page ? 'default' : 'outline'"
:variant="item.value === currentPage ? 'default' : 'outline'"
class="size-5 p-0 text-sm"
>
{{ item.value }}
Expand Down

0 comments on commit 3bd5ef4

Please sign in to comment.