refactor: tidy injections of dropdown
This commit is contained in:
parent
4a3cef9a01
commit
ef417f3ccf
5 changed files with 14 additions and 12 deletions
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { dropdownContextKey } from './ctx'
|
||||
import { InjectionKeyDropdownContext } from '~/constants/symbols'
|
||||
|
||||
defineProps<{
|
||||
placement?: string
|
||||
}>()
|
||||
|
@ -8,7 +9,7 @@ const dropdown = $ref<any>()
|
|||
const colorMode = useColorMode()
|
||||
|
||||
const hide = () => dropdown.hide()
|
||||
provide(dropdownContextKey, {
|
||||
provide(InjectionKeyDropdownContext, {
|
||||
hide,
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue