From f32d1f412a79aef07ce5041f1d76d73c85375b0a Mon Sep 17 00:00:00 2001 From: Wu-K'ung <2292884238@qq.com> Date: Wed, 25 Apr 2018 21:05:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DautoComplete=E7=9A=84on-chang?= =?UTF-8?q?e=E4=BA=8B=E4=BB=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当使用v-model绑定value的时候on-change事件只会在第一次触发。 --- src/components/auto-complete/auto-complete.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/auto-complete/auto-complete.vue b/src/components/auto-complete/auto-complete.vue index de09b85d..730d2949 100644 --- a/src/components/auto-complete/auto-complete.vue +++ b/src/components/auto-complete/auto-complete.vue @@ -124,7 +124,9 @@ }, watch: { value (val) { - this.disableEmitChange = true; + if(this.currentValue !== val){ + this.disableEmitChange = true; + } this.currentValue = val; }, currentValue (val) { @@ -161,4 +163,4 @@ } } }; - \ No newline at end of file +