Commit 94e62882 authored by kingwl's avatar kingwl Committed by 杨奕

ColorPicker: while watch hue and value with computed

parent 1a9822eb
......@@ -27,18 +27,13 @@
}
},
watch: {
'color.value'() {
this.update();
},
/*
* FIXME: trigger update twice
* when saturation is zero, modify hue will not change value.
* panel also not to be updated. so i subscribe the hue change to update panel too.
* but if hue changed, update will be call twice.
*/
'color._hue'() {
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 };
}
},
......
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