HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/flowbite-vue/src/components/FwbTabs/FwbTab.vue
<template>
  <template v-if="directive === 'if'">
    <div v-if="activeTab === name">
      <slot />
    </div>
  </template>
  <template v-else-if="directive === 'show'">
    <div v-show="activeTab === name">
      <slot />
    </div>
  </template>
</template>

<script lang="ts" setup>
import { inject } from 'vue'
import {
  TAB_ACTIVE_NAME_INJECTION_KEY,
  TAB_VISIBILITY_DIRECTIVE_INJECTION_KEY,
} from './injection/config'

defineOptions({
  __FLOWBITE_TAB__: true, // add this to easily find tab components from tabs
})

defineProps({
  name: {
    type: String,
    required: true,
  },
  title: {
    type: String,
    default: '',
  },
  disabled: {
    type: Boolean,
    default: false,
  },
})

const activeTab = inject(TAB_ACTIVE_NAME_INJECTION_KEY, '')
const directive = inject(TAB_VISIBILITY_DIRECTIVE_INJECTION_KEY, 'if')
</script>