fix #1543
This commit is contained in:
parent
06290cb3a9
commit
ea060d98f1
2 changed files with 20 additions and 2 deletions
|
@ -1,8 +1,20 @@
|
||||||
<template>
|
<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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
total: 21
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
subject() {
|
||||||
|
this.total -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -135,6 +135,12 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
total (val) {
|
||||||
|
let maxPage = Math.ceil(val / this.currentPageSize);
|
||||||
|
if (maxPage < this.currentPage && maxPage > 0) {
|
||||||
|
this.currentPage = maxPage;
|
||||||
|
}
|
||||||
|
},
|
||||||
current (val) {
|
current (val) {
|
||||||
this.currentPage = val;
|
this.currentPage = val;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue