mirror of https://github.com/sveltejs/svelte
fix dynamic components inside elements - fixes #994
parent
a8eaa7e95c
commit
e20b38e7c0
@ -0,0 +1 @@
|
||||
<p>{{x}}, therefore Bar</p>
|
@ -0,0 +1 @@
|
||||
<p>{{x}}, therefore Foo</p>
|
@ -0,0 +1,19 @@
|
||||
export default {
|
||||
data: {
|
||||
x: true
|
||||
},
|
||||
|
||||
html: `
|
||||
<div><p>true, therefore Foo</p></div>
|
||||
`,
|
||||
|
||||
test(assert, component, target) {
|
||||
component.set({
|
||||
x: false
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<div><p>false, therefore Bar</p></div>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,14 @@
|
||||
<div>
|
||||
<:Component { x ? Foo : Bar } x='{{x}}'/>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import Foo from './Foo.html';
|
||||
import Bar from './Bar.html';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return { Foo, Bar };
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue