]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/components/SettingToggle.vue
Avoid hidding all info when copy pasting the exemple config
[github/bastienwirtz/homer.git] / src / components / SettingToggle.vue
index 985ca84f8f0c6344fa01395b062c8a72eb9599d3..efa7caa89e06142f8ebe8ce13422221fcd48ce54 100644 (file)
@@ -1,5 +1,8 @@
 <template>
-  <a v-on:click="toggleSetting()" class="navbar-item is-inline-block-mobile">
+  <a
+    @click.prevent="toggleSetting()"
+    class="navbar-item is-inline-block-mobile"
+  >
     <span><i :class="['fas', 'fa-fw', value ? icon : secondaryIcon]"></i></span>
     <slot></slot>
   </a>
@@ -12,6 +15,7 @@ export default {
     name: String,
     icon: String,
     iconAlt: String,
+    defaultValue: Boolean,
   },
   data: function () {
     return {
@@ -24,6 +28,8 @@ export default {
 
     if (this.name in localStorage) {
       this.value = JSON.parse(localStorage[this.name]);
+    } else {
+      this.value = this.defaultValue;
     }
 
     this.$emit("updated", this.value);