mirror of https://github.com/sveltejs/svelte
stack up append targets so that slotted content in nested components works in SSR mode (fixes #801)
parent
223dbee98c
commit
a68f7e103f
@ -0,0 +1,15 @@
|
|||||||
|
import { SsrGenerator } from './index';
|
||||||
|
import Block from './Block';
|
||||||
|
import { Node } from '../../interfaces';
|
||||||
|
|
||||||
|
export type Visitor = (
|
||||||
|
generator: SsrGenerator,
|
||||||
|
block: Block,
|
||||||
|
node: Node,
|
||||||
|
componentStack: Node[]
|
||||||
|
) => void;
|
||||||
|
|
||||||
|
export interface AppendTarget {
|
||||||
|
slots: Record<string, string>;
|
||||||
|
slotStack: string[]
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
<div class='inner'>
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
@ -0,0 +1,3 @@
|
|||||||
|
<div class='outer'>
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<div class='outer'>
|
||||||
|
<div class='inner'>foo</div>
|
||||||
|
</div>`
|
||||||
|
};
|
@ -0,0 +1,12 @@
|
|||||||
|
<Outer>
|
||||||
|
<Inner>foo</Inner>
|
||||||
|
</Outer>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Outer from './Outer.html';
|
||||||
|
import Inner from './Inner.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { Outer, Inner }
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue