fix[ThemePicker]: fixed bug when oldVal is null (#1517)

This commit is contained in:
花裤衩 2019-01-14 14:07:56 +08:00 committed by GitHub
parent c54e99d0a9
commit 109c393cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ export default {
} }
}, },
watch: { watch: {
theme(val, oldVal) { theme(val) {
const oldVal = this.theme
if (typeof val !== 'string') return if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', '')) const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', '')) const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))