feat(Pagination): pagination item custom render (#7222)

* feat(Pagination): pagination item custom render

* fix(Pagination): fix test result

* fix(Pagination): expose page object directly
This commit is contained in:
JSparow
2020-09-22 19:10:43 +08:00
committed by GitHub
parent 1eca65d05b
commit 106114333b
7 changed files with 135 additions and 3 deletions
+22
View File
@@ -44,6 +44,20 @@ export default {
/>
```
### Custom Render
```html
<van-pagination v-model="currentPage" :total-items="50" :show-page-size="5">
<template #prev-text>
<van-icon name="arrow-left" />
</template>
<template #next-text>
<van-icon name="arrow" />
</template>
<template #page="{ text }">{{ text }}</template>
</van-pagination>
```
## API
### Props
@@ -65,3 +79,11 @@ export default {
| Event | Description | Arguments |
| ------ | ------------------------ | --------- |
| change | Triggered on page change | - |
### Slots
| Name | Description | Default |
| --- | --- | --- |
| prev-text | custom prev slot | `-` |
| next-text | custom next slot | `-` |
| page | pagination item slot | `{ number: number, text: string, active: boolean }` |