Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Mar 16, 2020
1 parent 40c5df5 commit 20f1513
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/compile/render_dom/wrappers/Slot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default class SlotWrapper extends Wrapper {
name: this.renderer.component.get_unique_name(`fallback_block`),
type: 'fallback'
});
renderer.blocks.push(this.fallback);
}

this.fragment = new FragmentWrapper(
Expand Down Expand Up @@ -115,7 +116,6 @@ export default class SlotWrapper extends Wrapper {

if (this.fallback) {
this.fragment.render(this.fallback, null, x`#nodes` as Identifier);
renderer.blocks.push(this.fallback);
}

const slot = block.get_unique_name(`${sanitize(slot_name)}_slot`);
Expand Down
6 changes: 6 additions & 0 deletions test/runtime/samples/component-slot-fallback-3/Inner.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<slot>
<div>Hello</div>
<div>world</div>
<div>Bye</div>
<div>World</div>
</slot>
6 changes: 6 additions & 0 deletions test/runtime/samples/component-slot-fallback-3/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
html: `
<div>Hello World</div>
<div>Hello</div><div>world</div><div>Bye</div><div>World</div>
`,
};
9 changes: 9 additions & 0 deletions test/runtime/samples/component-slot-fallback-3/main.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script>
import Inner from "./Inner.svelte";
</script>

<Inner>
<div>Hello World</div>
</Inner>

<Inner></Inner>

0 comments on commit 20f1513

Please sign in to comment.