Build system integration using vue-cli.

This commit is contained in:
Bastien Wirtz
2020-05-25 15:07:03 -07:00
parent ab7ac44c19
commit b9c5fcf085
69 changed files with 10028 additions and 10347 deletions

View File

@@ -0,0 +1,41 @@
<template>
<a v-on:click="toggleSetting()" class="navbar-item is-inline-block-mobile">
<span v-show="value"><i :class="['fas', icon]"></i></span>
<span v-show="!value"><i :class="['fas', iconAlt]"></i></span>
<slot></slot>
</a>
</template>
<script>
export default {
name: "SettingToggle",
props: {
name: String,
icon: String,
iconAlt: String,
},
data: function () {
return {
value: true,
};
},
created: function () {
if (!this.iconAlt) {
this.iconAlt = this.icon;
}
if (this.name in localStorage) {
this.value = JSON.parse(localStorage[this.name]);
}
this.$emit("updated", this.value);
},
methods: {
toggleSetting: function () {
this.value = !this.value;
localStorage[this.name] = this.value;
this.$emit("updated", this.value);
},
},
};
</script>