Commit 87ec808291ba356858f258e39d8c56c5cc490ee8
1 parent
3cf3629f
fixed ColorPicker Hue bug
when select a color from recommend colors, the Hue can not focus the correct color position(percent).
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
src/components/color-picker/hue.vue
@@ -48,6 +48,12 @@ export default { | @@ -48,6 +48,12 @@ export default { | ||
48 | }; | 48 | }; |
49 | }, | 49 | }, |
50 | 50 | ||
51 | + watch: { | ||
52 | + value () { | ||
53 | + this.percent = clamp(this.value.hsl.h * 100 / 360, 0, 100); | ||
54 | + } | ||
55 | + }, | ||
56 | + | ||
51 | methods: { | 57 | methods: { |
52 | change(percent) { | 58 | change(percent) { |
53 | this.percent = clamp(percent, 0, 100); | 59 | this.percent = clamp(percent, 0, 100); |