( branch: IfBranchNode, keyIndex: number, context: TransformContext, )
| 217 | } |
| 218 | |
| 219 | function createCodegenNodeForBranch( |
| 220 | branch: IfBranchNode, |
| 221 | keyIndex: number, |
| 222 | context: TransformContext, |
| 223 | ): IfConditionalExpression | BlockCodegenNode | MemoExpression { |
| 224 | if (branch.condition) { |
| 225 | return createConditionalExpression( |
| 226 | branch.condition, |
| 227 | createChildrenCodegenNode(branch, keyIndex, context), |
| 228 | // make sure to pass in asBlock: true so that the comment node call |
| 229 | // closes the current block. |
| 230 | createCallExpression(context.helper(CREATE_COMMENT), [ |
| 231 | __DEV__ ? '"v-if"' : '""', |
| 232 | 'true', |
| 233 | ]), |
| 234 | ) as IfConditionalExpression |
| 235 | } else { |
| 236 | return createChildrenCodegenNode(branch, keyIndex, context) |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | function createChildrenCodegenNode( |
| 241 | branch: IfBranchNode, |
no test coverage detected