Page add event @on-prev and @on-next
This commit is contained in:
parent
d8d1bcb92b
commit
d8fdd9bb6a
2 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<Page prev-text="上一页" next-text="下一页" :total="total" show-sizer show-elevator show-total :current.sync="current"></Page>
|
||||
<Page prev-text="上一页" next-text="下一页" @on-prev="op" @on-next="on" :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>
|
||||
|
@ -49,6 +49,12 @@
|
|||
},
|
||||
change() {
|
||||
this.current = 1;
|
||||
},
|
||||
op (p) {
|
||||
console.log(111, p)
|
||||
},
|
||||
on (p) {
|
||||
console.log(110, p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,6 +260,7 @@
|
|||
return false;
|
||||
}
|
||||
this.changePage(current - 1);
|
||||
this.$emit('on-prev', current - 1);
|
||||
},
|
||||
next () {
|
||||
if (this.disabled) return;
|
||||
|
@ -268,6 +269,7 @@
|
|||
return false;
|
||||
}
|
||||
this.changePage(current + 1);
|
||||
this.$emit('on-next', current + 1);
|
||||
},
|
||||
fastPrev () {
|
||||
if (this.disabled) return;
|
||||
|
|
Loading…
Add table
Reference in a new issue