Closed njzydark closed 5 years ago
I want to save theme in localStorage and init theme in created,but it doesn't work. In spa mode,it work.
created() { if (process.browser) { this.initTheme() } }, methods: { initTheme() { if (window.localStorage.defaultTheme) { var theme = JSON.parse(window.localStorage.defaultTheme) } this.defaultTheme = theme ? theme.base : colors.blue.base this.$vuetify.theme.primary = theme ? theme : colors.blue }, handleThemeCheck(theme) { window.localStorage.defaultTheme = JSON.stringify(theme) this.defaultTheme = theme.base this.$vuetify.theme.primary = theme } }
hello! I have a problem similar to yours. Could you tell me how to solve it? Thank you very much!
Same issue here, some solutions?
I want to save theme in localStorage and init theme in created,but it doesn't work. In spa mode,it work.