Doc (#4172): Fixing the unclear slot with fallback content example

pull/4203/head
Thomas Ferro 6 years ago
parent ff4a38be96
commit 9e670dfa8f

@ -1202,14 +1202,16 @@ The content is exposed in the child component using the `<slot>` element, which
```html
<!-- App.svelte -->
<Widget></Widget>
<Widget>
<p>this is some child content</p>
<p>this is some child content that will overwrite the default slot content</p>
</Widget>
<!-- Widget.svelte -->
<div>
<slot>
this will be rendered if someone does <Widget/>
this fallback content will be rendered when no content is provided, like in the first example
</slot>
</div>
```

Loading…
Cancel
Save