Commit f32d1f412a79aef07ce5041f1d76d73c85375b0a

Authored by Wu-K'ung
Committed by GitHub
1 parent c45f05dd

修复autoComplete的on-change事件的bug

当使用v-model绑定value的时候on-change事件只会在第一次触发。
Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
src/components/auto-complete/auto-complete.vue
... ... @@ -124,7 +124,9 @@
124 124 },
125 125 watch: {
126 126 value (val) {
127   - this.disableEmitChange = true;
  127 + if(this.currentValue !== val){
  128 + this.disableEmitChange = true;
  129 + }
128 130 this.currentValue = val;
129 131 },
130 132 currentValue (val) {
... ... @@ -161,4 +163,4 @@
161 163 }
162 164 }
163 165 };
164   -</script>
165 166 \ No newline at end of file
  167 +</script>
... ...