diff --git a/src/generators/dom/Block.ts b/src/generators/dom/Block.ts index 0d786752dc..49f4f81d86 100644 --- a/src/generators/dom/Block.ts +++ b/src/generators/dom/Block.ts @@ -163,7 +163,7 @@ export default class Block { } child(options: BlockOptions) { - return new Block(Object.assign({}, this, options, { parent: this })); + return new Block(Object.assign({}, this, { key: null }, options, { parent: this })); } contextualise(expression: Node, context?: string, isEventHandler?: boolean) { diff --git a/test/runtime/samples/if-in-keyed-each/_config.js b/test/runtime/samples/if-in-keyed-each/_config.js new file mode 100644 index 0000000000..d7f8c5870d --- /dev/null +++ b/test/runtime/samples/if-in-keyed-each/_config.js @@ -0,0 +1,15 @@ +export default { + data: { + items: [ + { id: 1, name: 'one' }, + { id: 2, name: 'two' } + ] + }, + + html: ` +