fix: make sure v-if and v-for work together
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { createStructuralDirectiveTransform } from '../transform'
|
||||
import {
|
||||
createStructuralDirectiveTransform,
|
||||
traverseChildren
|
||||
} from '../transform'
|
||||
import {
|
||||
NodeTypes,
|
||||
ElementTypes,
|
||||
@@ -37,6 +40,9 @@ export const transformIf = createStructuralDirectiveTransform(
|
||||
branch.children = [...comments, ...branch.children]
|
||||
}
|
||||
sibling.branches.push(branch)
|
||||
// since the branch was removed, it will not be traversed.
|
||||
// make sure to traverse here.
|
||||
traverseChildren(branch, context)
|
||||
} else {
|
||||
context.onError(
|
||||
createCompilerError(
|
||||
|
||||
Reference in New Issue
Block a user