Moved tabicons into a component

This commit is contained in:
Joel Collins 2019-06-10 11:28:11 +01:00
parent d302a77d6e
commit 0014d61f89
3 changed files with 114 additions and 25 deletions

View file

@ -0,0 +1,52 @@
<template>
<a
href="#"
:class="classObject"
:uk-tooltip="tooltipOptions"
@click="setThisTab">
</a>
</template>
<script>
export default {
name: 'tabIcon',
props: {
id: String,
currentTab: String,
requireConnection: Boolean,
name: String
},
methods: {
setThisTab(event, value) {
this.$emit('set-tab', event, this.id);
}
},
computed: {
tooltipOptions: function () {
return `pos: right; title: ${this.name}`
},
classObject: function () {
return {
'tabicon-active': this.currentTab == this.id,
'uk-disabled': (this.requireConnection && !this.$store.getters.ready)
}
}
}
}
</script>
<style lang="less" scoped>
// Custom UIkit CSS modifications
@import "../assets/less/theme.less";
.tabicon-active {
color: @global-button-background !important;
}
</style>