diff --git a/src/generators/nodes/Slot.ts b/src/generators/nodes/Slot.ts index 4bcd034a55bf..2a2251448d45 100644 --- a/src/generators/nodes/Slot.ts +++ b/src/generators/nodes/Slot.ts @@ -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(); diff --git a/test/runtime/samples/component-slot-dynamic/Nested.html b/test/runtime/samples/component-slot-dynamic/Nested.html new file mode 100644 index 000000000000..c7e0ccfad3eb --- /dev/null +++ b/test/runtime/samples/component-slot-dynamic/Nested.html @@ -0,0 +1,13 @@ + + {{foo}} + + + diff --git a/test/runtime/samples/component-slot-dynamic/_config.js b/test/runtime/samples/component-slot-dynamic/_config.js new file mode 100644 index 000000000000..17f22b283063 --- /dev/null +++ b/test/runtime/samples/component-slot-dynamic/_config.js @@ -0,0 +1,9 @@ +export default { + html: ` +

override default slot

+ `, + + test(assert, component) { + component.refs.nested.set({ foo: 'b' }); + } +}; diff --git a/test/runtime/samples/component-slot-dynamic/main.html b/test/runtime/samples/component-slot-dynamic/main.html new file mode 100644 index 000000000000..348754d88cb3 --- /dev/null +++ b/test/runtime/samples/component-slot-dynamic/main.html @@ -0,0 +1,13 @@ + +

override default slot

+
+ +