if (condition) {
// v-if or v-else-if
const { push, indent, deindent, newline } = context
- push(`(${condition.content})`, condition)
+ push(`(`)
+ genExpression(condition, context)
+ push(`)`)
indent()
context.indentLevel++
push(`? `)
transform(ast, {
...options,
nodeTransforms: [
+ ...(!__BROWSER__ && options.useWith === false ? [rewriteExpression] : []),
transformIf,
transformFor,
- ...(!__BROWSER__ && options.useWith === false ? [rewriteExpression] : []),
prepareElementForCodegen,
...(options.nodeTransforms || []) // user transforms
],
}
}
}
- } else if (node.type === NodeTypes.IF) {
- for (let i = 0; i < node.branches.length; i++) {}
- } else if (node.type === NodeTypes.FOR) {
}
}
})
return {
- type: NodeTypes.EXPRESSION,
- content: '',
- isStatic: false,
- loc: node.loc,
+ ...node,
children
}
}
if (aliases) {
// TODO inject identifiers to context
+ // and remove on exit
context.replaceNode({
type: NodeTypes.FOR,
loc: node.loc,