Commit cc7a461d authored by kingwl's avatar kingwl Committed by 杨奕

ColorPicker: replace watch hue with computed

parent 94e62882
......@@ -32,8 +32,15 @@
};
},
computed: {
hueValue() {
const hue = this.color.get('hue');
return hue;
}
},
watch: {
'color._hue'() {
hueValue() {
this.update();
}
},
......
......@@ -28,15 +28,19 @@
},
computed: {
// while watch hue and value with computed to call update once
colorValue() {
const hue = this.color.get('hue');
const value = this.color.get('value');
this.update();
return { hue, value };
}
},
watch: {
colorValue() {
this.update();
}
},
methods: {
update() {
const saturation = this.color.get('saturation');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment