fix(compiler): update v-if directive to use Comment instead of Empty (#208)
This commit is contained in:
@@ -211,6 +211,9 @@ export function generate(
|
||||
// to provide the helper here.
|
||||
if (ast.hoists.length) {
|
||||
push(`const _${helperNameMap[CREATE_VNODE]} = Vue.createVNode\n`)
|
||||
if (ast.helpers.includes(COMMENT)) {
|
||||
push(`const _${helperNameMap[COMMENT]} = Vue.Comment\n`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -484,7 +487,7 @@ function genComment(node: CommentNode, context: CodegenContext) {
|
||||
if (__DEV__) {
|
||||
const { push, helper } = context
|
||||
push(
|
||||
`${helper(CREATE_VNODE)}(${helper(COMMENT)}, 0, ${JSON.stringify(
|
||||
`${helper(CREATE_VNODE)}(${helper(COMMENT)}, null, ${JSON.stringify(
|
||||
node.content
|
||||
)})`,
|
||||
node
|
||||
|
||||
Reference in New Issue
Block a user