diff --git a/packages/core/primitive/src/primitive.ts b/packages/core/primitive/src/primitive.ts index 55f2e7c32..7b6a660c4 100644 --- a/packages/core/primitive/src/primitive.ts +++ b/packages/core/primitive/src/primitive.ts @@ -27,19 +27,18 @@ const Primitive = NODES.reduce((primitive, node) => { onMounted(() => { (window as any)[Symbol.for('oku-ui')] = true }) + const Tag: any = asChild.value ? OkuSlot : node return () => { const mergedProps = mergeProps(attrs, primitiveProps) - return createVNode(Tag, { ...mergedProps, ref: composedRefs }, slots.default?.()) + + return createVNode(Tag, { ...mergedProps, ref: composedRefs }, slots) } }, }) - const NodeProps = selectNode as typeof selectNode - & (new () => { - $props: OkuElement - }) + const NodeProps = selectNode as typeof selectNode & (new () => { $props: OkuElement }) return { ...primitive, [node]: NodeProps } }, {} as Primitives)