]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: root
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Sat, 25 Nov 2023 19:24:12 +0000 (03:24 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Sat, 25 Nov 2023 19:24:12 +0000 (03:24 +0800)
packages/compiler-vapor/__tests__/__snapshots__/compile.test.ts.snap
packages/compiler-vapor/__tests__/__snapshots__/fixtures.test.ts.snap
packages/compiler-vapor/src/generate.ts

index 3c48100962c36fbf073528a72f2a8f9dc021c8d4..3cf060766c94408e3a14f6452711be20b7168b55 100644 (file)
@@ -13,7 +13,7 @@ export function render() {
         1: [n3],
       },
     ],
-  } = children(root);
+  } = children(n0);
   const n2 = createTextNode(count.value);
   insert(n2, n1, n3);
   watchEffect(() => {
@@ -32,7 +32,7 @@ export function render() {
   const n0 = t0();
   const {
     0: [n1],
-  } = children(root);
+  } = children(n0);
   watchEffect(() => {
     setAttr(n1, 'id', undefined, id.value);
   });
@@ -49,7 +49,7 @@ export function render() {
   const n0 = t0();
   const {
     0: [n1],
-  } = children(root);
+  } = children(n0);
   watchEffect(() => {
     setHtml(n1, undefined, '');
   });
@@ -66,7 +66,7 @@ export function render() {
   const n0 = t0();
   const {
     0: [n1],
-  } = children(root);
+  } = children(n0);
   watchEffect(() => {
     setHtml(n1, undefined, code.value);
   });
@@ -83,7 +83,7 @@ export function render() {
   const n0 = t0();
   const {
     0: [n1],
-  } = children(root);
+  } = children(n0);
   watchEffect(() => {
     on(n1, 'click', handleClick);
   });
@@ -100,7 +100,7 @@ export function render() {
   const n0 = t0();
   const {
     0: [n1],
-  } = children(root);
+  } = children(n0);
   watchEffect(() => {
     setAttr(n1, 'id', undefined, foo);
   });
@@ -121,7 +121,7 @@ export function render() {
         1: [n3],
       },
     ],
-  } = children(root);
+  } = children(n0);
   const n2 = createTextNode(msg.value);
   insert(n2, n1, 0 /* InsertPosition.FIRST */);
   setText(n2, undefined, msg.value);
@@ -139,7 +139,7 @@ export function render() {
   const n0 = t0();
   const {
     0: [n1],
-  } = children(root);
+  } = children(n0);
   watchEffect(() => {
     setText(n1, undefined, '');
   });
@@ -156,7 +156,7 @@ export function render() {
   const n0 = t0();
   const {
     0: [n1],
-  } = children(root);
+  } = children(n0);
   watchEffect(() => {
     setText(n1, undefined, str.value);
   });
index b60215ff8a88f64ffb8886d3b9ed3b5143f8ff10..ea13872b7a73c0ee79d535a65fe5c5a33fb02da2 100644 (file)
@@ -20,7 +20,7 @@ const increment = () => count.value++
 
 return (() => {
 const n0 = t0()
-const { 1: [n1], 2: [n3], 3: [n5], 4: [n6], 6: [n7],} = children(root)
+const { 1: [n1], 2: [n3], 3: [n5], 4: [n6], 6: [n7],} = children(n0)
 const n2 = createTextNode(count.value)
 insert(n2, n1)
 const n4 = createTextNode(double.value)
index c8e2f9e625e7934e7e827634b935278918b33490..baac961ab3d512712f31fdda1a179ba3fbb3892a 100644 (file)
@@ -30,7 +30,9 @@ export function generate(
   {
     code += `const n${ir.children.id} = t0()\n`
     if (Object.keys(ir.children.children).length) {
-      code += `const {${genChildren(ir.children.children)}} = children(root)\n`
+      code += `const {${genChildren(ir.children.children)}} = children(n${
+        ir.children.id
+      })\n`
       vaporHelpers.add('children')
     }