|
@@ -34,7 +34,7 @@ import {
|
|
|
OPEN_BLOCK,
|
|
OPEN_BLOCK,
|
|
|
CREATE_VNODE
|
|
CREATE_VNODE
|
|
|
} from '../runtimeHelpers'
|
|
} from '../runtimeHelpers'
|
|
|
-import { injectProp, findDir, findProp } from '../utils'
|
|
|
|
|
|
|
+import { injectProp, findDir, findProp, isBuiltInType } from '../utils'
|
|
|
import { PatchFlags, PatchFlagNames } from '@vue/shared'
|
|
import { PatchFlags, PatchFlagNames } from '@vue/shared'
|
|
|
|
|
|
|
|
export const transformIf = createStructuralDirectiveTransform(
|
|
export const transformIf = createStructuralDirectiveTransform(
|
|
@@ -146,7 +146,16 @@ export function processIf(
|
|
|
// move the node to the if node's branches
|
|
// move the node to the if node's branches
|
|
|
context.removeNode()
|
|
context.removeNode()
|
|
|
const branch = createIfBranch(node, dir)
|
|
const branch = createIfBranch(node, dir)
|
|
|
- if (__DEV__ && comments.length) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ __DEV__ &&
|
|
|
|
|
+ comments.length &&
|
|
|
|
|
+ // #3619 ignore comments if the v-if is direct child of <transition>
|
|
|
|
|
+ !(
|
|
|
|
|
+ context.parent &&
|
|
|
|
|
+ context.parent.type === NodeTypes.ELEMENT &&
|
|
|
|
|
+ isBuiltInType(context.parent.tag, 'transition')
|
|
|
|
|
+ )
|
|
|
|
|
+ ) {
|
|
|
branch.children = [...comments, ...branch.children]
|
|
branch.children = [...comments, ...branch.children]
|
|
|
}
|
|
}
|
|
|
|
|
|