3 @click.prevent="toggleSetting()"
4 class="navbar-item is-inline-block-mobile"
6 <span><i :class="['fas', 'fa-fw', value ? icon : secondaryIcon]"></i></span>
13 name: "SettingToggle",
18 defaultValue: Boolean,
26 created: function () {
27 this.secondaryIcon = this.iconAlt || this.icon;
29 if (this.name in localStorage) {
30 this.value = JSON.parse(localStorage[this.name]);
32 this.value = this.defaultValue;
35 this.$emit("updated", this.value);
38 toggleSetting: function () {
39 this.value = !this.value;
40 localStorage[this.name] = this.value;
41 this.$emit("updated", this.value);