diff --git a/packages/elements/src/chain-of-thought/ChainOfThought.vue b/packages/elements/src/chain-of-thought/ChainOfThought.vue index 2386370..ac12b63 100644 --- a/packages/elements/src/chain-of-thought/ChainOfThought.vue +++ b/packages/elements/src/chain-of-thought/ChainOfThought.vue @@ -2,8 +2,7 @@ import type { HTMLAttributes, Ref } from 'vue' import { cn } from '@repo/shadcn-vue/lib/utils' import { useVModel } from '@vueuse/core' -import { provide } from 'vue' -import { ChainOfThoughtContextKey } from './context' +import { provideChainOfThought } from './context' interface ChainOfThoughtProps { modelValue?: boolean @@ -28,7 +27,12 @@ const isOpen = useVModel(props, 'modelValue', emit, { passive: true, }) -provide(ChainOfThoughtContextKey, isOpen as Ref) +provideChainOfThought({ + isOpen: isOpen as Ref, + setIsOpen: (open: boolean) => { + isOpen.value = open + }, +})