From fec6e4f3c83df7a5e004b0e35d3ae3a89f2a2d6a Mon Sep 17 00:00:00 2001 From: Pan Date: Mon, 14 Jan 2019 14:07:03 +0800 Subject: [PATCH] fix[ThemePicker]: fixed bug when oldVal is null --- src/components/ThemePicker/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue index e797d6c2..5d1ff8bd 100644 --- a/src/components/ThemePicker/index.vue +++ b/src/components/ThemePicker/index.vue @@ -18,7 +18,8 @@ export default { } }, watch: { - theme(val, oldVal) { + theme(val) { + const oldVal = this.theme if (typeof val !== 'string') return const themeCluster = this.getThemeCluster(val.replace('#', '')) const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))