From 4a1abc04f6a47c2eafbca7cbff2d269e98bb26f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Mon, 27 May 2019 15:41:54 +0800 Subject: [PATCH] [bugfix] Pagination: should not emit change event when total-items changed --- packages/pagination/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/pagination/index.js b/packages/pagination/index.js index 95aead243..3999d0b66 100644 --- a/packages/pagination/index.js +++ b/packages/pagination/index.js @@ -93,11 +93,14 @@ export default sfc({ }, methods: { - select(page) { + select(page, emitChange) { page = Math.min(this.count, Math.max(1, page)); if (this.value !== 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 onSelect = value => () => { - this.select(value); + this.select(value, true); }; return (