mirror of https://github.com/sveltejs/svelte
Merge pull request #1630 from sveltejs/gh-1621
register dependencies of dynamic component expressionspull/1636/head
commit
7c51094012
@ -0,0 +1 @@
|
|||||||
|
<p>Bar</p>
|
@ -0,0 +1 @@
|
|||||||
|
<p>Foo</p>
|
@ -0,0 +1,17 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<p>Foo</p>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test(assert, component, target) {
|
||||||
|
const { Bar } = component.get();
|
||||||
|
|
||||||
|
component.set({
|
||||||
|
x: Bar
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<p>Bar</p>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,18 @@
|
|||||||
|
{#if x}
|
||||||
|
<svelte:component this={x}/>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Foo from './Foo.html';
|
||||||
|
import Bar from './Bar.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
x: Foo,
|
||||||
|
Foo,
|
||||||
|
Bar
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue