fix deconflicting variable name for slot fallback (#4564)

pull/4277/head
Tan Li Hau 5 years ago committed by GitHub
parent 40c5df51a2
commit cdc0270ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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(
@ -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`);

@ -0,0 +1,6 @@
<slot>
<div>Hello</div>
<div>world</div>
<div>Bye</div>
<div>World</div>
</slot>

@ -0,0 +1,6 @@
export default {
html: `
<div>Hello World</div>
<div>Hello</div><div>world</div><div>Bye</div><div>World</div>
`,
};

@ -0,0 +1,9 @@
<script>
import Inner from "./Inner.svelte";
</script>
<Inner>
<div>Hello World</div>
</Inner>
<Inner></Inner>
Loading…
Cancel
Save