Pagination: add hide-on-single-page attribute (#15096)

This commit is contained in:
hetech
2019-04-19 15:52:06 +08:00
committed by GitHub
parent 2a65c9df7e
commit e5385e8531
7 changed files with 138 additions and 4 deletions

View File

@@ -140,6 +140,34 @@ Add more modules based on your scenario.
```
:::
### Hide pagination when there is only one page
When there is only one page, hide the pagination by setting the `hide-on-single-page` attribute.
:::demo
```html
<div>
<el-switch v-model="value">
</el-switch>
<el-pagination
:hide-on-single-page="value"
:total="5"
layout="prev, pager, next">
</el-pagination>
</div>
<script>
export default {
data() {
return {
value: false
}
}
}
</script>
```
:::
### Attributes
| Attribute | Description | Type | Accepted Values | Default |
|--------------------|----------------------------------------------------------|-------------------|-------------|--------|
@@ -156,6 +184,7 @@ Add more modules based on your scenario.
| prev-text | text for the prev button | string | — | — |
| next-text | text for the next button | string | — | — |
| disabled | whether Pagination is disabled | boolean | — | false |
| hide-on-single-page | whether to hide when there's only one page | boolean | — | - |
### Events
| Event Name | Description | Parameters |