Skip to content

Commit 03e95d7

Browse files
committed
tweak genIf
1 parent 5339426 commit 03e95d7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/compiler/codegen/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ function genIfConditions (
141141

142142
const condition = conditions.shift()
143143
if (condition.exp) {
144-
return `(${condition.exp})?(${
144+
return `(${condition.exp})?${
145145
genTernaryExp(condition.block)
146-
}):(${
146+
}:${
147147
genIfConditions(conditions, state, altGen, altEmpty)
148-
})`
148+
}`
149149
} else {
150150
return `${genTernaryExp(condition.block)}`
151151
}

src/server/optimizing-compiler/codegen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function genStringElementWithChildren (el, state) {
120120
}
121121

122122
function elementToString (el, state) {
123-
return flattenSegments(elementToSegments(el, state))
123+
return `(${flattenSegments(elementToSegments(el, state))})`
124124
}
125125

126126
function elementToSegments (el, state): Array<StringSegment> {

0 commit comments

Comments
 (0)