-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation for the pagination component
- Loading branch information
1 parent
785c0c9
commit f293158
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/vue-docs/docs/components/data-display/pagination/ShowCaseBaseUsage.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
import { UniPagination } from "unify-ui"; | ||
const total = ref(100); | ||
const pageSize = ref(10); | ||
const current = ref(1); | ||
function handleChange(params: { current: number; pageSize: number }) { | ||
console.log(params); | ||
current.value = params.current; | ||
pageSize.value = params.pageSize; | ||
} | ||
</script> | ||
|
||
<template> | ||
<div>total: {{ total }}</div> | ||
<div>pageSize: {{ pageSize }}</div> | ||
<div>current: {{ current }}</div> | ||
|
||
<UniPagination | ||
:total="total" | ||
:page-size="pageSize" | ||
:current="current" | ||
@chagne="handleChange" | ||
></UniPagination> | ||
</template> |
35 changes: 35 additions & 0 deletions
35
packages/vue-docs/docs/components/data-display/pagination/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup lang='ts'> | ||
import ShowCaseBaseUsage from './ShowCaseBaseUsage.vue' | ||
</script> | ||
|
||
# Pagination | ||
|
||
## Basic Usage | ||
|
||
::: raw | ||
<ShowCaseBaseUsage /> | ||
::: | ||
|
||
::: details View Source | ||
<<< @/components/data-display/pagination/ShowCaseBaseUsage.vue | ||
::: | ||
|
||
## API | ||
|
||
### Properties | ||
|
||
```ts | ||
defineProps<{ | ||
total: number; | ||
pageSize: number; | ||
current: number; | ||
}>(); | ||
``` | ||
|
||
### Events | ||
|
||
```ts | ||
const emits = defineEmits<{ | ||
(e: "chagne", params: { current: number; pageSize: number }): void; | ||
}>(); | ||
``` |