Merge pull request #1479 from sveltejs/gh-1470

always create outro method for top-level block
pull/1490/head
Rich Harris 6 years ago committed by GitHub
commit 8b20837e2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,6 +55,10 @@ export default function dom(
compiler.fragment.build();
const { block } = compiler.fragment;
if (compiler.options.nestedTransitions) {
block.hasOutroMethod = true;
}
// prevent fragment being created twice (#1063)
if (options.customElement) block.builders.create.addLine(`this.c = @noop;`);

@ -0,0 +1,15 @@
export default {
skipIntroByDefault: true,
nestedTransitions: true,
data: {
foo: true,
},
html: '<div>A wild component appears</div>',
test(assert, component, target) {
component.set({ foo: false });
assert.htmlEqual(target.innerHTML, '');
},
};

@ -0,0 +1,11 @@
{#if foo}
<Widget/>
{/if}
<script>
export default {
components: {
Widget: './Widget.html'
}
};
</script>
Loading…
Cancel
Save