File tree Expand file tree Collapse file tree
packages/leches/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,14 +49,19 @@ const panelWidth = ref(DEFAULT_WIDTH)
4949const resizeEdge = ref <' right' | ' left' | ' bottom' | ' corner' | ' corner-left' | null >(null )
5050
5151// Controls
52- const controls = useControlsProvider (uuid ?.value )
52+ useControlsProvider (uuid ?.value )
5353const hasSlots = ref (false )
5454const { store : controlsStore, triggers : controlsTriggers } = useControlsStore ()
5555
56- defineExpose (controls )
56+ // Reactive getter — controlsStore[uuid] may not exist yet when TresLeches
57+ // mounts before child components register their controls via useControls()
58+ const controls = computed (() => controlsStore [uuid .value ] || {})
59+
60+ defineExpose ({ controls })
5761
5862function onChange(key : string , value : string ) {
59- const control = controls [key ] as any
63+ const control = controls .value [key ] as any
64+ if (! control ) { return }
6065 // Update the ref (control.value is a ref)
6166 if (isRef (control .value )) {
6267 control .value .value = value
You can’t perform that action at this time.
0 commit comments