We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
This title may be not clear... An example may be better:
I have this component which declares a slot and gives two slot variable which are in fact components
<script lang="ts"> import AvatarImage from './AvatarImage.svelte'; import AvatarFallback from './AvatarFallback.svelte'; </script> <div> <slot {AvatarImage} {AvatarFallback} /> </div>
We use it like so:
<Avatar let:AvatarImage let:AvatarFallback> <AvatarImage src="https://randomuser.me/api/portraits/women/33.jpg" /> <AvatarFallback>👩💻</AvatarFallback> </Avatar>
I wonder how to use that inside the svelte addon because I tried multiple things and still got this error
this={...} of <svelte:component> should specify a Svelte component.
Here how I use it (which doesn't work)
<Meta title="Avatar" component={Avatar} /> <Template let:args> <!-- also tried here --> <Avatar {...args} /> </Template> <Story name="Example" let:AvatarImage let:AvatarFallback> <AvatarImage src="https://randomuser.me/api/portraits/women/33.jpg" /> <AvatarFallback>👩💻</AvatarFallback> </Story>
I guess it works similar has if it was:
<script> let active = false; </script> <slot {active} />
The text was updated successfully, but these errors were encountered:
You have to use your component in the Template or in the Story, like so :
<Story name="Example"> <Avatar let:AvatarImage let:AvatarFallback> <AvatarImage src="https://randomuser.me/api/portraits/women/33.jpg" /> <AvatarFallback>👩💻</AvatarFallback> </Avatar> </Story>
It worked on my side, hope this helps !
Sorry, something went wrong.
It looks like this was answered
Hello, You have to use your component in the Template or in the Story, like so : <Story name="Example"> <Avatar let:AvatarImage let:AvatarFallback> <AvatarImage src="https://randomuser.me/api/portraits/women/33.jpg" /> <AvatarFallback>👩💻</AvatarFallback> </Avatar> </Story> It worked on my side, hope this helps !
Thanks !
No branches or pull requests
Hello,
This title may be not clear... An example may be better:
I have this component which declares a slot and gives two slot variable which are in fact components
We use it like so:
I wonder how to use that inside the svelte addon because I tried multiple things and still got this error
Here how I use it (which doesn't work)
I guess it works similar has if it was:
The text was updated successfully, but these errors were encountered: