ant-design-vue/components/pagination/demo/changer.md

45 lines
786 B
Markdown
Raw Normal View History

2018-03-10 14:39:12 +00:00
<cn>
#### 改变
改变每页显示条目数。
</cn>
<us>
#### Changer
Change `pageSize`.
</us>
```html
<template>
2018-03-11 05:47:42 +00:00
<div>
<a-pagination showSizeChanger @showSizeChange="onShowSizeChange" :defaultCurrent="3" :total="500" />
<br/>
<a-pagination showSizeChanger :pageSize.sync="pageSize" @showSizeChange="onShowSizeChange" :total="500" v-model="current"/>
</div>
2018-03-10 14:39:12 +00:00
</template>
<script>
export default {
2018-03-11 05:47:42 +00:00
data(){
return {
pageSize: 20,
current:4,
}
},
watch:{
pageSize(val) {
console.log('pageSize',val);
},
current(val) {
console.log('current',val);
}
},
2018-03-10 14:39:12 +00:00
methods: {
onShowSizeChange(current, pageSize) {
console.log(current, pageSize);
}
}
}
</script>
```