Add test to deal with 5 layers of slot forwarding and defaults

pull/8546/head
Nguyen Tran 3 years ago
parent da1cd90a30
commit 041ef059f9

@ -0,0 +1,13 @@
<script>
import Component2 from './Component2.svelte';
</script>
<Component2>
<slot name="first" slot="first" />
<slot name="second" slot="second">
<h3>Component 2 second default slot</h3>
</slot>
<slot name="third" slot="third" />
<slot name="fourth" slot="fourth" />
<slot name="fifth" slot="fifth" />
</Component2>

@ -0,0 +1,13 @@
<script>
import Component3 from './Component3.svelte';
</script>
<Component3>
<slot name="first" slot="first" />
<slot name="second" slot="second" />
<slot name="third" slot="third">
<h3>Component 3 third default slot</h3>
</slot>
<slot name="fourth" slot="fourth" />
<slot name="fifth" slot="fifth" />
</Component3>

@ -0,0 +1,13 @@
<script>
import Component4 from './Component4.svelte';
</script>
<Component4>
<slot name="first" slot="first" />
<slot name="second" slot="second" />
<slot name="third" slot="third" />
<slot name="fourth" slot="fourth">
<h3>Component 4 fourth default slot</h3>
</slot>
<slot name="fifth" slot="fifth" />
</Component4>

@ -0,0 +1,5 @@
<slot name="first">First slot's default text</slot>
<slot name="second">Second slot's default text</slot>
<slot name="third">Third slot's default text</slot>
<slot name="fourth">Fourth slot's default text</slot>
<slot name="fifth">Fifth slot's default text</slot>

@ -0,0 +1,9 @@
export default {
html: `
<h3 slot="first">First slot</h3>
<h3>Component 2 second default slot</h3>
<h3>Component 3 third default slot</h3>
<h3>Component 4 fourth default slot</h3>
Fifth slot's default text
`
};

@ -0,0 +1,7 @@
<script>
import Component1 from './Component1.svelte';
</script>
<Component1>
<h3 slot="first">First slot</h3>
</Component1>
Loading…
Cancel
Save