mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Pagination: should not emit change event when total-items changed
This commit is contained in:
parent
32dbb7904b
commit
58dbbc8358
@ -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 (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user