]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: update
authordaiwei <daiwei521@126.com>
Tue, 31 Dec 2024 02:45:35 +0000 (10:45 +0800)
committerdaiwei <daiwei521@126.com>
Tue, 31 Dec 2024 02:45:35 +0000 (10:45 +0800)
packages/compiler-vapor/__tests__/transforms/__snapshots__/vIf.spec.ts.snap
packages/compiler-vapor/src/generators/if.ts

index 581804838878ef97f1b387f70ae0c1cab0a68ca9..419c8420d50e2a51276eabd5a0b9cf3ae3a309f9 100644 (file)
@@ -28,7 +28,7 @@ export function render(_ctx) {
   const n0 = _createIf(() => (_ctx.ok) ? () => {
     const n2 = t0()
     return n2
-  } : () => (_ctx.orNot) ? () => {
+  } : _ctx.orNot ? () => {
     const n5 = t1()
     const n6 = t2()
     return [n5, n6]
@@ -104,7 +104,7 @@ export function render(_ctx) {
   const n0 = _createIf(() => (_ctx.ok) ? () => {
     const n2 = t0()
     return n2
-  } : () => (_ctx.orNot) ? () => {
+  } : _ctx.orNot ? () => {
     const n4 = t1()
     return n4
   } : () => {
@@ -124,7 +124,7 @@ export function render(_ctx) {
   const n0 = _createIf(() => (_ctx.ok) ? () => {
     const n2 = t0()
     return n2
-  } : () => (_ctx.orNot) ? () => {
+  } : _ctx.orNot ? () => {
     const n4 = t1()
     return n4
   } : undefined)
index e3c9b6ab4750f9aac67bdd666b8cfc93227b0c48..cccb1607f179c74161b85e3aa723fccfd3d2f30f 100644 (file)
@@ -14,9 +14,9 @@ export function genIf(
   const [frag, push] = buildCodeFragment()
 
   const codes: CodeFragment[] = [
-    '() => (',
+    isNested?undefined:'() => (',
     ...genExpression(condition, context),
-    ')',
+    isNested?undefined:')',
   ]
 
   let positiveArg = genBlock(positive, context)