浏览代码

Select: fix value clear bug when value is initialized in mounted hook

Leopoldthecoder 8 年之前
父节点
当前提交
a11e8d115c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/select/src/select.vue

+ 2 - 2
packages/select/src/select.vue

@@ -216,7 +216,7 @@
         });
       },
 
-      selected(val) {
+      selected(val, oldVal) {
         if (this.multiple) {
           if (this.selected.length > 0) {
             this.currentPlaceholder = '';
@@ -247,7 +247,7 @@
             this.selectedInit = false;
             return;
           }
-          this.valueChangeBySelected = true;
+          if (val.value === oldVal.value) return;
           this.$emit('input', val.value);
           this.$emit('change', val.value);
         }