feat: add dropdown

This commit is contained in:
Alexandr
2022-07-08 20:36:05 +03:00
parent 4fb027fcb4
commit a5ffeffb82
12 changed files with 228 additions and 29 deletions

View File

@@ -1,7 +1,5 @@
<template>
<div>
<slot />
</div>
<slot />
</template>
<script lang="ts" setup>
import type { PropType } from 'vue'

View File

@@ -1,4 +1,4 @@
import type { FlowbiteThemablePayload, FlowbiteTheme } from '../types'
import type { FlowbiteTheme } from '../types'
import type { Ref } from 'vue'
import { computed, inject } from 'vue'
import { FLOWBITE_THEMABLE_INJECTION_KEY } from '../injection/config'
@@ -10,6 +10,7 @@ type UseFlowbiteThemableReturns = {
disabledClasses: Ref<string>
borderClasses: Ref<string>
isActive: Ref<boolean>
color: Ref<FlowbiteTheme | undefined>
}
type FlowbiteThemeMap = { background: string, disabled: string, hover: string, text: string, border: string }
@@ -60,7 +61,8 @@ export function useFlowbiteThemable(): UseFlowbiteThemableReturns {
const theme = inject<Ref<FlowbiteTheme>>(FLOWBITE_THEMABLE_INJECTION_KEY)
const isActive = computed(() => !!theme)
const isActive = computed(() => !!theme?.value)
const color = computed(() => theme?.value)
const backgroundClasses = computed(() => {
if(!theme) return ''
@@ -94,5 +96,6 @@ export function useFlowbiteThemable(): UseFlowbiteThemableReturns {
textClasses,
borderClasses,
isActive,
color,
}
}