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 {
/>
```
### 自定义渲染
```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 {
| 事件名 | 说明 | 回调参数 |
| ------ | -------------- | -------- |
| change | 页码改变时触发 | - |
### Slots
| 名称 | 描述 | 默认值 |
| --- | --- | --- |
| prev-text | 自定义上一页插槽 | `-` |
| next-text | 自定义下一页插槽 | `-` |
| page | 自定义页码插槽 | `{ number: number, text: string, active: boolean }` |