From b904fd871d7bf95c62abeddbcad02337701a6fe5 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Wed, 23 Aug 2017 15:51:08 +0800 Subject: [PATCH] update AutoComplete --- src/components/auto-complete/auto-complete.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/auto-complete/auto-complete.vue b/src/components/auto-complete/auto-complete.vue index c90a709..4475092 100644 --- a/src/components/auto-complete/auto-complete.vue +++ b/src/components/auto-complete/auto-complete.vue @@ -82,7 +82,8 @@ }, data () { return { - currentValue: this.value + currentValue: this.value, + disableEmitChange: false // for Form reset }; }, computed: { @@ -99,11 +100,16 @@ }, watch: { value (val) { + this.disableEmitChange = true; this.currentValue = val; }, currentValue (val) { this.$refs.select.query = val; this.$emit('input', val); + if (this.disableEmitChange) { + this.disableEmitChange = false; + return; + } this.$emit('on-change', val); this.dispatch('FormItem', 'on-form-change', val); } -- libgit2 0.21.4