We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d2a5c26 + 43023cb commit 4e09782Copy full SHA for 4e09782
components/CodeSwitcher.vue
@@ -62,16 +62,20 @@ export default {
62
return this.selectedLanguage = value
63
}
64
65
- localStorage.setItem(this.localStorageKey, value)
+ if (process.isClient) {
66
+ localStorage.setItem(this.localStorageKey, value)
67
+ }
68
this.root.$emit('change', { name: this.name, value })
69
70
},
71
72
created () {
73
if (this.isolated) return
74
- let selected = localStorage.getItem(this.localStorageKey)
- if (selected) this.selectedLanguage = selected
75
76
+ let selected = localStorage.getItem(this.localStorageKey)
77
+ if (selected) this.selectedLanguage = selected
78
79
80
this.root.$on('change', ({ name, value }) => {
81
if (name === this.name)
0 commit comments