Skip to content

Commit

Permalink
refactor: primitive use only slots
Browse files Browse the repository at this point in the history
  • Loading branch information
Cr0zy07 committed Nov 28, 2023
1 parent 34eed36 commit def6c25
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/core/primitive/src/primitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof node, true>
})
const NodeProps = selectNode as typeof selectNode & (new () => { $props: OkuElement<typeof node, true> })

return { ...primitive, [node]: NodeProps }
}, {} as Primitives)
Expand Down

0 comments on commit def6c25

Please sign in to comment.