commit
0da09e9a8c
2 changed files with 20 additions and 2 deletions
|
@ -1,8 +1,20 @@
|
|||
<template>
|
||||
<Page :total="100" show-sizer show-elevator show-total></Page>
|
||||
<div>
|
||||
<Page :total="total" show-sizer show-elevator show-total></Page>
|
||||
<Button type="primary" @click="subject">- 1</Button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data () {
|
||||
return {
|
||||
total: 21
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
subject() {
|
||||
this.total -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -135,6 +135,12 @@
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
total (val) {
|
||||
let maxPage = Math.ceil(val / this.currentPageSize);
|
||||
if (maxPage < this.currentPage && maxPage > 0) {
|
||||
this.currentPage = maxPage;
|
||||
}
|
||||
},
|
||||
current (val) {
|
||||
this.currentPage = val;
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue