emit current update when page changed
This commit is contained in:
parent
f3c6cd68d1
commit
6355250e52
2 changed files with 8 additions and 1 deletions
|
@ -1,19 +1,25 @@
|
|||
<template>
|
||||
<div>
|
||||
<Page :total="total" show-sizer show-elevator show-total></Page>
|
||||
<Page :total="total" show-sizer show-elevator show-total :current.sync="current"></Page>
|
||||
{{ current }}
|
||||
<Button type="primary" @click="subject">- 1</Button>
|
||||
<Button type="primary" @click="change">Change</Button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
current: 1,
|
||||
total: 21
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
subject() {
|
||||
this.total -= 1;
|
||||
},
|
||||
change() {
|
||||
this.current = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,6 +214,7 @@
|
|||
changePage (page) {
|
||||
if (this.currentPage != page) {
|
||||
this.currentPage = page;
|
||||
this.$emit('update:current', page);
|
||||
this.$emit('on-change', page);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue