vant/docs/markdown/en-US/pagination.md
neverland 80e3c6dd65
[new feature] Pagination code review (#328)
* fix: Tabbar icon line-height

* [new feature] progress add showPivot prop

* [new feature] TabItem support vue-router

* [new feature] update document header style

* [Doc] add toast english ducoment

* [bugfix] Search box-sizing wrong

* [Doc] update vant-demo respo

* [Doc] translate theme & demo pages

* [Doc] add Internationalization document

* [bugfix] remove unnecessary props

* [fix] optimize clickoutside

* [new feature] optimize find-parent

* [new feature]: change document title accordinng to language

* [new feature] Pagination code review
2017-11-17 01:12:49 -06:00

70 lines
1.2 KiB
Markdown

## Pagination
### Install
``` javascript
import { Pagination } from 'vant';
Vue.component(Pagination.name, Pagination);
```
### Usage
#### Basic Usage
```html
<van-pagination
v-model="currentPage"
:totalItems="24"
:itemsPerPage="5"
/>
```
```javascript
export default {
data() {
return {
currentPage: 1
}
}
}
```
#### Simple mode
```html
<van-pagination
v-model="currentPage"
:pageCount="12"
mode="simple"
/>
```
#### Show ellipses
```html
<van-pagination
v-model="currentPage"
:totalItems="125"
:showPageSize="3"
:forceEllipses="true"
/>
```
### API
| Attribute | Description | Type | Default | Accepted Values |
|-----------|-----------|-----------|-------------|-------------|
| v-model | pageModel | `Object` | - | - |
| mode | mode | `String` | `multi` | `simple` |
| itemsPerPage | itemsPerPage | `Number` | `10` | - |
| prevText | previousText | `String` | `Previous` | - |
| nextText | nextText | `String` | `Next` | - |
| showPageSize | showPageSize | `Number` | `5` | - |
| forceEllipses | ellipses | `Boolean` | `false` | - |
### Event
| Event | Description | Attribute |
|-----------|-----------|-----------|
| change | Triggered on page change | - |