Add non-popup styling for tabs component
This commit is contained in:
parent
1c0a2361d6
commit
177b661d50
|
@ -1,9 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="flex-none w-maxc flex flex-col justify-between border-b-2 group-[.is-popup]:border-zinc-500 mb-3">
|
<div class="flex-none w-maxc flex flex-col justify-between border-b-2 border-gray-500 group-[.is-popup]:border-zinc-500 mb-3">
|
||||||
<div class="flex space-x-1 px-2">
|
<div class="flex space-x-1 px-2">
|
||||||
<a v-for="(item, index) in entries" :key="index" href="#" class="rounded-t-lg py-1 px-3 text-zinc-300"
|
<a
|
||||||
:class="index === modelValue ? `group-[.is-popup]:bg-zinc-600` : ''" @click.prevent="openMenu(index)"
|
v-for="(item, index) in entries"
|
||||||
v-text="item.title"></a>
|
:key="index"
|
||||||
|
href="#"
|
||||||
|
class="rounded-t-lg py-1 px-3 text-zinc-300"
|
||||||
|
:class="index === modelValue ? `bg-gray-700 group-[.is-popup]:bg-zinc-600` : ''"
|
||||||
|
@click.prevent="openMenu(index)"
|
||||||
|
v-text="item.title"
|
||||||
|
></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -11,9 +17,18 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: {},
|
modelValue: {
|
||||||
entries: {},
|
type: Number,
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
|
entries: {
|
||||||
|
required: true,
|
||||||
|
validator: function (entries) {
|
||||||
|
return entries.filter((e) => e.title === undefined || typeof e.title !== 'string' || e.title.length === 0).length === 0;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emits: ['update:modelValue'],
|
||||||
methods: {
|
methods: {
|
||||||
openMenu(index) {
|
openMenu(index) {
|
||||||
this.$emit('update:modelValue', index);
|
this.$emit('update:modelValue', index);
|
||||||
|
|
Loading…
Reference in New Issue