|
@@ -14,17 +14,23 @@ export default {
|
|
|
} else {
|
|
|
this.themeIdx = idx
|
|
|
}
|
|
|
+ },
|
|
|
+ updateColorThemeByStorage() {
|
|
|
+ const settings = localStorage.getItem('ariaSettings')
|
|
|
+ if (settings) {
|
|
|
+ this.themeIdx = JSON.parse(settings).themeIdx
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.updateColorTheme()
|
|
|
- window.addEventListener('storage', this.updateColorTheme, {
|
|
|
+ window.addEventListener('storage', this.updateColorThemeByStorage, {
|
|
|
passive: true,
|
|
|
})
|
|
|
this.$eventBus.$on('color-modification', this.updateColorTheme)
|
|
|
},
|
|
|
destroyed() {
|
|
|
- window.removeEventListener('storage', this.updateColorTheme, {
|
|
|
+ window.removeEventListener('storage', this.updateColorThemeByStorage, {
|
|
|
passive: true,
|
|
|
})
|
|
|
this.$eventBus.$off('color-modification', this.updateColorTheme)
|