27 lines
842 B
Vue
27 lines
842 B
Vue
<script setup lang="ts">
|
|
import { ref } from 'vue'
|
|
const isActive = ref(true);
|
|
|
|
function switchHiddenElement(){
|
|
isActive.value = !isActive.value;
|
|
}
|
|
|
|
const props = defineProps(
|
|
{
|
|
categoryName: {required : true}
|
|
}
|
|
)
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
|
<button @click="switchHiddenElement()" type="button" :class="[isActive ? 'rounded-t-lg bg-white dark:bg-gray-700' : 'rounded-lg']" class="w-full p-2 text-lg font-bold text-gray-900 transition duration-75 hover:bg-blue-100 dark:text-white dark:hover:bg-gray-600">
|
|
<span class="flex-1 whitespace-nowrap">{{props.categoryName}}</span>
|
|
</button>
|
|
<div class="flex flex-col w-full mb-4 py-2 bg-white dark:bg-gray-700 rounded-b-xl font-thin overflow-hidden" :class="[isActive ? 'active' : 'hidden']">
|
|
<slot></slot>
|
|
</div>
|
|
</template> |