Skip to content

Commit

Permalink
Merge pull request #23784 from nasvillanueva/text_slot
Browse files Browse the repository at this point in the history
Vue3: Use slot value directly if it's a string in source decorator
  • Loading branch information
kasperpeulen authored Aug 23, 2023
2 parents 1c465ce + d8f94c0 commit f8bcec8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions code/renderers/vue3/src/docs/sourceDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ function mapSlots(
?.bindings?.map((b) => b.name)
.join(',');

if (typeof slot === 'function') {
if (typeof slot === 'string') {
slotContent = slot;
} else if (typeof slot === 'function') {
slotContent = generateExpression(slot);
}
if (isVNode(slot)) {
} else if (isVNode(slot)) {
slotContent = generateComponentSource(slot);
}

if (typeof slot === 'object' && !isVNode(slot)) {
} else if (typeof slot === 'object' && !isVNode(slot)) {
slotContent = JSON.stringify(slot);
}

const bindingsString = scropedArgs ? `="{${scropedArgs}}"` : '';
slotContent = slot ? `<template #${key}${bindingsString}>${slotContent}</template>` : ``;

Expand Down

0 comments on commit f8bcec8

Please sign in to comment.