? _createBlock(\\"div\\", _hoisted_1, [
_hoisted_2
])
- : _createCommentVNode())
+ : _createCommentVNode(\\"v-if\\", true))
]))
}
}"
? _createBlock(_Fragment, { key: 0 }, _renderList(list, (i) => {
return (_openBlock(), _createBlock(\\"div\\"))
}), 128 /* UNKEYED_FRAGMENT */)
- : _createCommentVNode())
+ : _createCommentVNode(\\"v-if\\", true))
}
}"
`;
return (_openBlock(), ok
? _createBlock(\\"div\\", { key: 0 })
- : _createCommentVNode())
+ : _createCommentVNode(\\"v-if\\", true))
}
}"
`;
\\"hello\\",
_createVNode(\\"p\\")
])
- : _createCommentVNode())
+ : _createCommentVNode(\\"v-if\\", true))
}
}"
`;
return (_openBlock(), ok
? _renderSlot($slots, \\"default\\", { key: 0 })
- : _createCommentVNode())
+ : _createCommentVNode(\\"v-if\\", true))
}
}"
`;
? _createBlock(\\"div\\", { key: 0 })
: orNot
? _createBlock(\\"p\\", { key: 1 })
- : _createCommentVNode())
+ : _createCommentVNode(\\"v-if\\", true))
}
}"
`;
return (_openBlock(), ok
? _renderSlot($slots, \\"default\\", { key: 0 })
- : _createCommentVNode())
+ : _createCommentVNode(\\"v-if\\", true))
}
}"
`;
return createConditionalExpression(
branch.condition,
createChildrenCodegenNode(branch, index, context),
- createCallExpression(context.helper(CREATE_COMMENT))
+ // make sure to pass in asBlock: true so that the comment node call
+ // closes the current block.
+ createCallExpression(context.helper(CREATE_COMMENT), [
+ __DEV__ ? '"v-if"' : '""',
+ 'true'
+ ])
) as IfConditionalExpression
} else {
return createChildrenCodegenNode(branch, index, context) as BlockCodegenNode
return createVNode(Text, null, text, flag)
}
-export function createCommentVNode(text: string = ''): VNode {
- return createVNode(Comment, null, text)
+export function createCommentVNode(
+ text: string = '',
+ // when used as the v-else branch, the comment node must be created as a
+ // block to ensure correct updates.
+ asBlock: boolean = false
+): VNode {
+ return asBlock
+ ? createBlock(Comment, null, text)
+ : createVNode(Comment, null, text)
}
export function normalizeVNode(child: VNodeChild): VNode {