瀏覽代碼

ColorPicker: add immediate watcher for currentColor (#13278)

SkyAo 6 年之前
父節點
當前提交
f8a27565b0
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 5 2
      packages/color-picker/src/components/picker-dropdown.vue
  2. 1 0
      packages/color-picker/src/main.vue

+ 5 - 2
packages/color-picker/src/components/picker-dropdown.vue

@@ -109,8 +109,11 @@
         }
       },
 
-      currentColor(val) {
-        this.customInput = val;
+      currentColor: {
+        immediate: true,
+        handler(val) {
+          this.customInput = val;
+        }
       }
     }
   };

+ 1 - 0
packages/color-picker/src/main.vue

@@ -165,6 +165,7 @@
         enableAlpha: this.showAlpha,
         format: this.colorFormat
       });
+
       return {
         color,
         showPicker: false,