Skip to content

Commit

Permalink
fix(components)!: remove renderScopedSlots prop
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Aug 22, 2022
1 parent d5a50ad commit 2a914e2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/schema-org/runtime/components/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const defineSchemaOrgComponent = (name: string, defineFn: (input: any) =>
name,
props: {
as: String,
renderScopedSlots: Boolean,
},
setup(props, { slots, attrs }) {
const node = ref(null)
Expand Down Expand Up @@ -70,17 +69,11 @@ export const defineSchemaOrgComponent = (name: string, defineFn: (input: any) =>
return () => {
const data = unref(nodePartial)
// renderless component
if (!slots.default && !props.renderScopedSlots)
if (!slots.default)
return null
const childSlots = []
if (slots.default)
childSlots.push(slots.default(data))
if (props.renderScopedSlots) {
for (const [key, slot] of Object.entries(slots)) {
if (slot && key !== 'default')
childSlots.push(slot(data))
}
}
return h(props.as || 'div', {}, childSlots)
}
},
Expand Down

0 comments on commit 2a914e2

Please sign in to comment.