UPD: TabSelect

This commit is contained in:
Robert Kossessa
2024-02-04 01:45:56 +01:00
parent c47f55f51d
commit 43efab863b
2 changed files with 8 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
<div class="relative">
<div
:style="backgroundStyle"
class="absolute bg-zinc-300 outline outline-zinc-100 rounded-xl transition-all ease-out duration-75" />
class="absolute bg-zinc-300 outline outline-zinc-100 rounded-xl transition-all duration-75 ease-out" />
<div class="flex font-heading px-4 py-2 gap-2 relative">
<TabSelectButton
v-for="(option, key) in options" :key="key"
@@ -29,7 +29,12 @@ const model = defineModel({
const buttons = ref({})
const backgroundStyle = ref({})
const backgroundStyle = ref({
top: '0',
left: '0',
width: '0',
height: '0',
})
const updateBackgroundStyle = () => {
const selected = buttons.value[model.value]

View File

@@ -1,7 +1,7 @@
<template>
<button
class="flex-1 flex flex-col items-center rounded-xl p-1 gap-2 transition-colors"
:class="{'text-black hover:bg-zinc-200': selected,
:class="{'text-black bg-zinc-300 hover:bg-zinc-200': selected,
'hover:bg-zinc-800 text-muted-foreground' : !selected}"
@click="$emit('select'); $refs.title.scramble()">
<slot v-if="$slots['replace']" name="replace" />