wrap <slot> updates in conditional - fixes #1144

pull/1185/head
Rich Harris 7 years ago
parent 805c72fefc
commit c2bb549901

@ -57,6 +57,7 @@ export default class Slot extends Element {
block.builders.create.pushCondition(`!${content_name}`);
block.builders.hydrate.pushCondition(`!${content_name}`);
block.builders.mount.pushCondition(`!${content_name}`);
block.builders.update.pushCondition(`!${content_name}`);
block.builders.unmount.pushCondition(`!${content_name}`);
block.builders.destroy.pushCondition(`!${content_name}`);
@ -67,6 +68,7 @@ export default class Slot extends Element {
block.builders.create.popCondition();
block.builders.hydrate.popCondition();
block.builders.mount.popCondition();
block.builders.update.popCondition();
block.builders.unmount.popCondition();
block.builders.destroy.popCondition();

@ -0,0 +1,13 @@
<slot>
<span>{{foo}}</span>
</slot>
<script>
export default {
data() {
return {
foo: 'a'
};
}
};
</script>

@ -0,0 +1,9 @@
export default {
html: `
<p>override default slot</p>
`,
test(assert, component) {
component.refs.nested.set({ foo: 'b' });
}
};

@ -0,0 +1,13 @@
<Nested ref:nested>
<p>override default slot</p>
</Nested>
<script>
import Nested from './Nested.html';
export default {
components: {
Nested
}
};
</script>
Loading…
Cancel
Save