Skip to content

Commit

Permalink
Updated: Pagination component example code.
Browse files Browse the repository at this point in the history
  • Loading branch information
moshiur01 committed Dec 18, 2024
1 parent 7c3168a commit 8632ccc
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions components/content/docs/components/pagination/paginationCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const DefaultPaginationCode = {
import { PhDotsThree } from "@phosphor-icons/vue";
import { Pagination, PaginationItem, PaginationList } from "keep-vue";
const activePage = ref<number>(1);
const handlePageClick = (pageNumber: number) => {
const activePage = ref(1);
const handlePageClick = (pageNumber) => {
activePage.value = pageNumber;
};
</script>
Expand Down Expand Up @@ -32,7 +32,7 @@ const handlePageClick = (pageNumber: number) => {
4
</PaginationItem>
<PaginationItem>
<PhosphorIconDotsThree size="20" />
<PhDotsThree size="20" />
</PaginationItem>
<PaginationItem
:active="activePage === 10"
Expand All @@ -50,8 +50,8 @@ const PaginationNavigatorWithIconCode = {
import { PhCaretLeft, PhCaretRight, PhDotsThree } from "@phosphor-icons/vue";
import {Pagination, PaginationItem, PaginationList, PaginationNavigator} from "keep-vue";
const activePage = ref<number>(1);
const handlePageClick = (pageNumber: number) => {
const activePage = ref(1);
const handlePageClick = (pageNumber) => {
activePage.value = pageNumber;
};
Expand All @@ -70,7 +70,6 @@ const prevPage = () => {
activePage.value -= 1;
}
};
</script>
<template>
Expand All @@ -79,7 +78,7 @@ const prevPage = () => {
shape="circle"
:disabled="activePage === 1"
@click="prevPage">
<PhosphorIconCaretLeft size="18" />
<PhCaretLeft size="18" />
</PaginationNavigator>
<PaginationList>
<PaginationItem
Expand All @@ -103,7 +102,7 @@ const prevPage = () => {
4
</PaginationItem>
<PaginationItem>
<PhosphorIconDotsThree size="20" />
<PhDotsThree size="20" />
</PaginationItem>
<PaginationItem
:active="activePage === 10"
Expand All @@ -115,7 +114,7 @@ const prevPage = () => {
shape="circle"
:disabled="activePage === 10"
@click="nextPage">
<PhosphorIconCaretRight size="18" />
<PhCaretRight size="18" />
</PaginationNavigator>
</Pagination>
</template>`,
Expand Down Expand Up @@ -154,7 +153,7 @@ const prevPage = () => {
:disabled="activePage === 1"
class="gap-1"
@click="prevPage">
<PhosphorIconCaretLeft size="18" />
<PhCaretLeft size="18" />
Previous
</PaginationNavigator>
<PaginationList>
Expand All @@ -179,7 +178,7 @@ const prevPage = () => {
4
</PaginationItem>
<PaginationItem>
<PhosphorIconDotsThree size="20" />
<PhDotsThree size="20" />
</PaginationItem>
<PaginationItem
:active="activePage === 10"
Expand All @@ -192,7 +191,7 @@ const prevPage = () => {
class="gap-1"
@click="nextPage">
Next
<PhosphorIconCaretRight size="18" />
<PhCaretRight size="18" />
</PaginationNavigator>
</Pagination>
</template>`,
Expand All @@ -202,9 +201,9 @@ const PaginationShapeCode = {
"PaginationComponent.vue": `<script setup>
import { PhDotsThree } from "@phosphor-icons/vue";
import { Pagination, PaginationItem, PaginationList } from "keep-vue";
const activePage = ref<number>(1);
const handlePageClick = (pageNumber: number) => {
const activePage = ref(1);
const handlePageClick = (pageNumber) => {
activePage.value = pageNumber;
};
Expand Down Expand Up @@ -233,7 +232,7 @@ const handlePageClick = (pageNumber: number) => {
4
</PaginationItem>
<PaginationItem>
<PhosphorIconDotsThree size="20" />
<PhDotsThree size="20" />
</PaginationItem>
<PaginationItem
:active="activePage === 10"
Expand All @@ -244,16 +243,17 @@ const handlePageClick = (pageNumber: number) => {
</Pagination>
</template>`,
};

const PaginationWithInputCode = {
"PaginationComponent.vue": `<script setup>
import { PhCaretLeft, PhCaretRight, PhDotsThree } from "@phosphor-icons/vue";
import { Input, Pagination, PaginationGoTo, PaginationItem, PaginationList, PaginationNavigator,} from "keep-vue";
const activePage = ref<number>(1);
const inputPage = ref<string>("");
const activePage = ref(1);
const inputPage = ref("");
const totalPages = 200;
const handlePageClick = (pageNumber: number) => {
const handlePageClick = (pageNumber) => {
activePage.value = pageNumber;
inputPage.value = "";
};
Expand Down Expand Up @@ -297,7 +297,7 @@ const handleGoToPage = () => {
shape="circle"
:disabled="activePage === 1"
@click="prevPage">
<PhosphorIconCaretLeft size="18" />
<PhCaretLeft size="18" />
</PaginationNavigator>
<PaginationList>
<PaginationItem
Expand All @@ -321,7 +321,7 @@ const handleGoToPage = () => {
4
</PaginationItem>
<PaginationItem>
<PhosphorIconDotsThree size="20" />
<PhDotsThree size="20" />
</PaginationItem>
<PaginationItem
:active="activePage === 10"
Expand All @@ -333,7 +333,7 @@ const handleGoToPage = () => {
shape="circle"
:disabled="activePage === totalPages"
@click="nextPage">
<PhosphorIconCaretRight size="18" />
<PhCaretRight size="18" />
</PaginationNavigator>
<PaginationGoTo>
<span>/ Go to</span>
Expand Down

0 comments on commit 8632ccc

Please sign in to comment.