[bugfix] Pagination: should not emit change event when total-items changed

This commit is contained in:
陈嘉涵 2019-05-27 15:41:54 +08:00
parent 32dbb7904b
commit 58dbbc8358

View File

@ -93,11 +93,14 @@ export default sfc({
}, },
methods: { methods: {
select(page) { select(page, emitChange) {
page = Math.min(this.count, Math.max(1, page)); page = Math.min(this.count, Math.max(1, page));
if (this.value !== page) { if (this.value !== page) {
this.$emit('input', page); this.$emit('input', page);
this.$emit('change', page);
if (emitChange) {
this.$emit('change', page);
}
} }
} }
}, },
@ -107,7 +110,7 @@ export default sfc({
const simple = this.mode !== 'multi'; const simple = this.mode !== 'multi';
const onSelect = value => () => { const onSelect = value => () => {
this.select(value); this.select(value, true);
}; };
return ( return (