mirror of https://github.com/sveltejs/svelte
Merge pull request #851 from sveltejs/gh-850
use anchor.parentNode as target instead of slot document fragmentpull/855/head
commit
14463380f7
@ -0,0 +1,3 @@
|
|||||||
|
<div>
|
||||||
|
<slot/>
|
||||||
|
</div>
|
@ -0,0 +1,16 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<div>
|
||||||
|
<p>unconditional</p>
|
||||||
|
</div>`,
|
||||||
|
|
||||||
|
test(assert, component, target) {
|
||||||
|
component.set({ foo: true });
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<div>
|
||||||
|
<p>conditional</p>
|
||||||
|
<p>unconditional</p>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,17 @@
|
|||||||
|
<Nested>
|
||||||
|
{{#if foo}}
|
||||||
|
<p>conditional</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<p>unconditional</p>
|
||||||
|
</Nested>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Nested from './Nested.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Nested
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1 @@
|
|||||||
|
<slot/>
|
@ -0,0 +1,13 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<p>disabled</p>
|
||||||
|
<p>unconditional</p>`,
|
||||||
|
|
||||||
|
test(assert, component, target) {
|
||||||
|
component.set({ enabled: true });
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<p>enabled</p>
|
||||||
|
<p>unconditional</p>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,19 @@
|
|||||||
|
<Nested>
|
||||||
|
{{#if !enabled}}
|
||||||
|
<p>disabled</p>
|
||||||
|
{{else}}
|
||||||
|
<p>enabled</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<p>unconditional</p>
|
||||||
|
</Nested>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Nested from './Nested.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Nested
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue