fix(compiler-core): should apply text transform to if branches
fix #725
This commit is contained in:
@@ -16,7 +16,8 @@ export const transformText: NodeTransform = (node, context) => {
|
||||
if (
|
||||
node.type === NodeTypes.ROOT ||
|
||||
node.type === NodeTypes.ELEMENT ||
|
||||
node.type === NodeTypes.FOR
|
||||
node.type === NodeTypes.FOR ||
|
||||
node.type === NodeTypes.IF_BRANCH
|
||||
) {
|
||||
// perform the transform on node exit so that all expressions have already
|
||||
// been processed.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
createStructuralDirectiveTransform,
|
||||
traverseChildren,
|
||||
TransformContext
|
||||
TransformContext,
|
||||
traverseNode
|
||||
} from '../transform'
|
||||
import {
|
||||
NodeTypes,
|
||||
@@ -125,7 +125,7 @@ export function processIf(
|
||||
const onExit = processCodegen && processCodegen(sibling, branch, false)
|
||||
// since the branch was removed, it will not be traversed.
|
||||
// make sure to traverse here.
|
||||
traverseChildren(branch, context)
|
||||
traverseNode(branch, context)
|
||||
// call on exit
|
||||
if (onExit) onExit()
|
||||
// make sure to reset currentNode after traversal to indicate this
|
||||
|
||||
Reference in New Issue
Block a user