diff options
Diffstat (limited to 'src/components/SettingToggle.vue')
-rw-r--r-- | src/components/SettingToggle.vue | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/components/SettingToggle.vue b/src/components/SettingToggle.vue index ffc91a1..985ca84 100644 --- a/src/components/SettingToggle.vue +++ b/src/components/SettingToggle.vue | |||
@@ -1,6 +1,6 @@ | |||
1 | <template> | 1 | <template> |
2 | <a v-on:click="toggleSetting()" class="navbar-item is-inline-block-mobile"> | 2 | <a v-on:click="toggleSetting()" class="navbar-item is-inline-block-mobile"> |
3 | <span><i :class="['fas', 'fa-fw', value ? icon : iconAlt]"></i></span> | 3 | <span><i :class="['fas', 'fa-fw', value ? icon : secondaryIcon]"></i></span> |
4 | <slot></slot> | 4 | <slot></slot> |
5 | </a> | 5 | </a> |
6 | </template> | 6 | </template> |
@@ -15,13 +15,12 @@ export default { | |||
15 | }, | 15 | }, |
16 | data: function () { | 16 | data: function () { |
17 | return { | 17 | return { |
18 | secondaryIcon: null, | ||
18 | value: true, | 19 | value: true, |
19 | }; | 20 | }; |
20 | }, | 21 | }, |
21 | created: function () { | 22 | created: function () { |
22 | if (!this.iconAlt) { | 23 | this.secondaryIcon = this.iconAlt || this.icon; |
23 | this.iconAlt = this.icon; | ||
24 | } | ||
25 | 24 | ||
26 | if (this.name in localStorage) { | 25 | if (this.name in localStorage) { |
27 | this.value = JSON.parse(localStorage[this.name]); | 26 | this.value = JSON.parse(localStorage[this.name]); |