feat: a little bit new structure
This commit is contained in:
@@ -23,12 +23,13 @@ import {
|
||||
TAB_ACTIVE_NAME_INJECTION_KEY,
|
||||
TAB_STYLE_INJECTION_KEY,
|
||||
TAB_VISIBILITY_DIRECTIVE_INJECTION_KEY,
|
||||
} from './config'
|
||||
import { useTabsClasses } from './useTabsClasses'
|
||||
} from './injection/config'
|
||||
import { useTabsClasses } from './composables/useTabsClasses'
|
||||
import type { PropType } from 'vue'
|
||||
import { computed, provide, toRef, useSlots } from 'vue'
|
||||
import { flatten } from '../../utils/flatten'
|
||||
import TabPane from './components/TabPane/TabPane.vue'
|
||||
import type { TabsVariant } from './types'
|
||||
|
||||
const props = defineProps({
|
||||
variant: {
|
||||
@@ -82,6 +83,4 @@ provide(TAB_ACTIVATE_INJECTION_KEY, onActivate)
|
||||
export default {
|
||||
inheritAttrs: false,
|
||||
}
|
||||
|
||||
export type TabsVariant = 'default' | 'underline' | 'pills'
|
||||
</script>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { inject } from 'vue'
|
||||
import { TAB_ACTIVE_NAME_INJECTION_KEY, TAB_VISIBILITY_DIRECTIVE_INJECTION_KEY } from '../../config'
|
||||
import { TAB_ACTIVE_NAME_INJECTION_KEY, TAB_VISIBILITY_DIRECTIVE_INJECTION_KEY } from '../../injection/config'
|
||||
|
||||
defineProps({
|
||||
name: {
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { inject, toRefs } from 'vue'
|
||||
import { TAB_ACTIVATE_INJECTION_KEY, TAB_STYLE_INJECTION_KEY } from '../../config'
|
||||
import type { TabsVariant } from '../../Tabs.vue'
|
||||
import { useTabClasses } from './useTabClasses'
|
||||
import { TAB_ACTIVATE_INJECTION_KEY, TAB_STYLE_INJECTION_KEY } from '../../injection/config'
|
||||
import type { TabsVariant } from '../../types'
|
||||
import { useTabClasses } from './composables/useTabClasses'
|
||||
|
||||
const props = defineProps({
|
||||
name: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Ref } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import type { TabsVariant } from './Tabs.vue'
|
||||
import type { TabsVariant } from '../types'
|
||||
|
||||
export type UseTabsClassesProps = {
|
||||
variant: TabsVariant
|
||||
@@ -1,3 +1,5 @@
|
||||
// dependency injection config for tabs
|
||||
|
||||
export const TAB_STYLE_INJECTION_KEY = 'flowbite-tab-style-injection'
|
||||
export const TAB_ACTIVE_NAME_INJECTION_KEY = 'flowbite-tab-active-name-injection'
|
||||
export const TAB_VISIBILITY_DIRECTIVE_INJECTION_KEY = 'flowbite-tab-visibility-directive-injection'
|
||||
1
src/components/Tabs/types.d.ts
vendored
Normal file
1
src/components/Tabs/types.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export type TabsVariant = 'default' | 'underline' | 'pills'
|
||||
Reference in New Issue
Block a user