From d07368c6c8db32eb5d861492e9cee84968b76824 Mon Sep 17 00:00:00 2001 From: other Date: Wed, 6 May 2020 09:58:29 +0800 Subject: [PATCH] fix data.js --- src/components/color-picker/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/color-picker/utils.js b/src/components/color-picker/utils.js index 37f3f51..217e94a 100644 --- a/src/components/color-picker/utils.js +++ b/src/components/color-picker/utils.js @@ -30,7 +30,7 @@ function getColor(data, colorData) { } export function changeColor(data, oldHue) { - const colorData = data === '' ? '#2d8cf0' : data; + const colorData = data === '' ? '#2d8cf0' : (data || ''); const color = getColor(data, colorData); const hsl = color.toHsl(); const hsv = color.toHsv(); @@ -115,4 +115,4 @@ export function simpleCheckForValidColor(data) { const results = keysToCheck.reduce(checkIteratee.bind(null, data), {checked: 0, passed: 0}); return results.checked === results.passed ? data : undefined; -} +} \ No newline at end of file -- libgit2 0.21.4