Closed kalnode closed 5 months ago
When I try to pass it html code it escapes it/displays as a string This code
args: {
default: `
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
`,
}
Displays like this:
Yes, this addon is still relevant as of Storybook 7 / 8. It is meant to be for convenience purposes to simplify the writing of slots and reduce redundancy. You can also achieve the same without the addon and you can use render()
function to change the way the component is shown in story. Inside of them, you can use Vue template and write slots as you normally would inside SFC's template
section.
I'm using SB7 and am able to pass content into Vue slots... without this add-on:
MyComponent.vue
MyComponent.stories.ts
Granted, I haven't gone very deep with slot features, In any case...
Does this add-on still do something useful in relation to Storybook version 7-and-up ?
Consider SB7 is their biggest update ever with full support for Vite and lots of improvements for Vue. https://storybook.js.org/blog/storybook-7-0/ https://github.com/storybookjs/storybook/pull/20498?ref=storybookblog.ghost.io