fix(compiler-core): should attach key to single element child of <template v-for> (#1910)
This commit is contained in:
@@ -145,6 +145,9 @@ export const transformFor = createStructuralDirectiveTransform(
|
||||
// but mark it as a block.
|
||||
childBlock = (children[0] as PlainElementNode)
|
||||
.codegenNode as VNodeCall
|
||||
if (isTemplate && keyProperty) {
|
||||
injectProp(childBlock, keyProperty, context)
|
||||
}
|
||||
childBlock.isBlock = !isStableFragment
|
||||
if (childBlock.isBlock) {
|
||||
helper(OPEN_BLOCK)
|
||||
|
||||
Reference in New Issue
Block a user