From 87ec808291ba356858f258e39d8c56c5cc490ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 22 May 2018 09:50:30 +0800 Subject: [PATCH] fixed ColorPicker Hue bug when select a color from recommend colors, the Hue can not focus the correct color position(percent). --- src/components/color-picker/hue.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/color-picker/hue.vue b/src/components/color-picker/hue.vue index b08c7b74..471e178f 100644 --- a/src/components/color-picker/hue.vue +++ b/src/components/color-picker/hue.vue @@ -48,6 +48,12 @@ export default { }; }, + watch: { + value () { + this.percent = clamp(this.value.hsl.h * 100 / 360, 0, 100); + } + }, + methods: { change(percent) { this.percent = clamp(percent, 0, 100);