adrema/resources/js/components/VTabs.vue

31 lines
762 B
Vue
Raw Normal View History

2022-09-06 00:36:14 +02:00
<template>
<div class="p-6 bg-gray-700 border-r border-gray-600 flex-none w-maxc flex flex-col justify-between">
<div class="grid gap-1">
<a
v-for="(item, index) in entries"
:key="index"
href="#"
@click.prevent="openMenu(index)"
class="rounded py-1 px-3 text-gray-400"
2022-10-20 02:15:28 +02:00
:class="index === value ? `bg-gray-600` : ''"
2022-09-06 00:36:14 +02:00
v-text="item.title"
></a>
</div>
<slot name="bottom"></slot>
</div>
</template>
<script>
export default {
props: {
value: {},
entries: {},
},
methods: {
openMenu(index) {
this.$emit('input', index);
},
},
};
</script>