pedi2/resources/js/components/comunes/TabsSecciones.vue

56 lines
1.3 KiB
Vue
Raw Normal View History

<template>
<div class="block">
<div class="tabs is-boxed" id="tabs">
<ul class="has-bottom-line">
<li v-for="(tab, index) in tabs" class="is-size-6"
2024-07-11 16:32:25 -03:00
:key="index"
:id="tab.id + '-tab'"
:class="{'is-active': tab.id === tabActiva}">
<a @click="setTabActiva(tab.id)">
2024-07-11 16:32:25 -03:00
<span>
{{ tab.nombre }}
</span>
</a>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
2024-12-21 13:20:34 -03:00
props: {
tabs: Array,
tabInicial: String,
},
data() {
return {
2024-12-21 13:20:34 -03:00
tabActiva: this.tabInicial,
}
},
methods: {
setTabActiva(tabId) {
this.$parent.setSeccionActiva(tabId);
this.tabActiva = tabId
}
}
}
</script>
<style lang="scss" scoped>
@import '../../../../node_modules/bulma';
hr {
border: none;
height: 1px;
}
.has-bottom-line {
border-bottom-color: #dbdbdb !important;
border-bottom-style: solid !important;
border-bottom-width: 1px !important;
}
.tabs li.is-active a {
border-bottom-color: #e3342f;
color: #e3342f;
}
2024-07-11 16:32:25 -03:00
</style>