fix(compiler-vapor): add newline after effect body
This commit is contained in:
parent
697102f796
commit
126796edb9
|
@ -340,7 +340,8 @@ export function render(_ctx) {
|
||||||
_renderEffect(() => {
|
_renderEffect(() => {
|
||||||
_on(n1, (_ctx.event) === "click" ? "mouseup" : (_ctx.event), () => _ctx.test, undefined, {
|
_on(n1, (_ctx.event) === "click" ? "mouseup" : (_ctx.event), () => _ctx.test, undefined, {
|
||||||
modifiers: ["middle"]
|
modifiers: ["middle"]
|
||||||
})})
|
})
|
||||||
|
})
|
||||||
return n0
|
return n0
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
@ -370,7 +371,8 @@ export function render(_ctx) {
|
||||||
_on(n1, (_ctx.event) === "click" ? "contextmenu" : (_ctx.event), () => _ctx.test, undefined, {
|
_on(n1, (_ctx.event) === "click" ? "contextmenu" : (_ctx.event), () => _ctx.test, undefined, {
|
||||||
modifiers: ["right"],
|
modifiers: ["right"],
|
||||||
keys: ["right"]
|
keys: ["right"]
|
||||||
})})
|
})
|
||||||
|
})
|
||||||
return n0
|
return n0
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
@ -398,7 +400,8 @@ export function render(_ctx) {
|
||||||
_on(n1, _ctx.e, () => _ctx.test, undefined, {
|
_on(n1, _ctx.e, () => _ctx.test, undefined, {
|
||||||
modifiers: ["left"],
|
modifiers: ["left"],
|
||||||
keys: ["left"]
|
keys: ["left"]
|
||||||
})})
|
})
|
||||||
|
})
|
||||||
return n0
|
return n0
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -76,14 +76,14 @@ export function genEffect({ operations }: IREffect, context: CodegenContext) {
|
||||||
`${vaporHelper('renderEffect')}(() => `,
|
`${vaporHelper('renderEffect')}(() => `,
|
||||||
)
|
)
|
||||||
|
|
||||||
const [fragOps, pushOps] = buildCodeFragment()
|
const [operationsExps, pushOps] = buildCodeFragment()
|
||||||
operations.forEach(op => pushOps(...genOperation(op, context)))
|
operations.forEach(op => pushOps(...genOperation(op, context)))
|
||||||
|
|
||||||
const newlineCount = fragOps.filter(frag => frag === NEWLINE).length
|
const newlineCount = operationsExps.filter(frag => frag === NEWLINE).length
|
||||||
if (newlineCount > 1) {
|
if (newlineCount > 1) {
|
||||||
push('{', INDENT_START, ...fragOps, INDENT_END, '})')
|
push('{', INDENT_START, ...operationsExps, INDENT_END, NEWLINE, '})')
|
||||||
} else {
|
} else {
|
||||||
push(...fragOps.filter(frag => frag !== NEWLINE), ')')
|
push(...operationsExps.filter(frag => frag !== NEWLINE), ')')
|
||||||
}
|
}
|
||||||
|
|
||||||
return frag
|
return frag
|
||||||
|
|
Loading…
Reference in New Issue