daiwei 10 месяцев назад
Родитель
Сommit
6233125d2d

+ 4 - 4
packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap

@@ -6,7 +6,7 @@ const t0 = _template("<div> </div>", true)
 
 
 export function render(_ctx, $props, $emit, $attrs, $slots) {
 export function render(_ctx, $props, $emit, $attrs, $slots) {
   const n0 = t0()
   const n0 = t0()
-  const x0 = _child(n0)
+  const x0 = _child(n0, -1)
   _renderEffect(() => _setText(x0, "count is " + _toDisplayString(_ctx.count) + "."))
   _renderEffect(() => _setText(x0, "count is " + _toDisplayString(_ctx.count) + "."))
   return n0
   return n0
 }"
 }"
@@ -186,7 +186,7 @@ _delegateEvents("click")
 
 
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = t0()
   const n0 = t0()
-  const x0 = _child(n0)
+  const x0 = _child(n0, -1)
   n0.$evtclick = e => _ctx.handleClick(e)
   n0.$evtclick = e => _ctx.handleClick(e)
   _renderEffect(() => {
   _renderEffect(() => {
     const _count = _ctx.count
     const _count = _ctx.count
@@ -203,7 +203,7 @@ const t0 = _template("<div> </div>", true)
 
 
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = t0()
   const n0 = t0()
-  const x0 = _child(n0)
+  const x0 = _child(n0, -1)
   _renderEffect(() => {
   _renderEffect(() => {
     _setProp(n0, "id", _ctx.foo)
     _setProp(n0, "id", _ctx.foo)
     _setText(x0, _toDisplayString(_ctx.bar))
     _setText(x0, _toDisplayString(_ctx.bar))
@@ -237,7 +237,7 @@ export function render(_ctx) {
   const n0 = _child(n3)
   const n0 = _child(n3)
   const n1 = _next(n0)
   const n1 = _next(n0)
   const n2 = _nthChild(n3, 3)
   const n2 = _nthChild(n3, 3)
-  const x0 = _child(n0)
+  const x0 = _child(n0, -1)
   _setText(x0, _toDisplayString(_ctx.foo))
   _setText(x0, _toDisplayString(_ctx.foo))
   _renderEffect(() => {
   _renderEffect(() => {
     _setText(n1, " " + _toDisplayString(_ctx.bar))
     _setText(n1, " " + _toDisplayString(_ctx.bar))

+ 2 - 2
packages/compiler-vapor/__tests__/transforms/__snapshots__/expression.spec.ts.snap

@@ -48,7 +48,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n1 = t0()
   const n1 = t0()
   const n0 = _child(n1)
   const n0 = _child(n1)
-  const x1 = _child(n1)
+  const x1 = _child(n1, -1)
   _renderEffect(() => {
   _renderEffect(() => {
     const _foo = _ctx.foo
     const _foo = _ctx.foo
     _setText(n0, _toDisplayString(_foo))
     _setText(n0, _toDisplayString(_foo))
@@ -87,7 +87,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n1 = t0()
   const n1 = t0()
   const n0 = _child(n1)
   const n0 = _child(n1)
-  const x1 = _child(n1)
+  const x1 = _child(n1, -1)
   _renderEffect(() => {
   _renderEffect(() => {
     const _String = String
     const _String = String
     const _foo = _ctx.foo
     const _foo = _ctx.foo

+ 6 - 6
packages/compiler-vapor/__tests__/transforms/__snapshots__/transformChildren.spec.ts.snap

@@ -26,8 +26,8 @@ export function render(_ctx) {
   const n0 = _child(n3)
   const n0 = _child(n3)
   const n1 = _next(n0)
   const n1 = _next(n0)
   const n2 = _next(n1)
   const n2 = _next(n1)
-  const x0 = _child(n0)
-  const x2 = _child(n2)
+  const x0 = _child(n0, -1)
+  const x2 = _child(n2, -1)
   _renderEffect(() => {
   _renderEffect(() => {
     _setText(x0, _toDisplayString(_ctx.first))
     _setText(x0, _toDisplayString(_ctx.first))
     _setText(n1, " " + _toDisplayString(_ctx.second) + " " + _toDisplayString(_ctx.third) + " ")
     _setText(n1, " " + _toDisplayString(_ctx.second) + " " + _toDisplayString(_ctx.third) + " ")
@@ -44,7 +44,7 @@ const t0 = _template("<div><div>x</div><div>x</div><div> </div></div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n1 = t0()
   const n1 = t0()
   const n0 = _nthChild(n1, 2)
   const n0 = _nthChild(n1, 2)
-  const x0 = _child(n0)
+  const x0 = _child(n0, -1)
   _renderEffect(() => _setText(x0, _toDisplayString(_ctx.msg)))
   _renderEffect(() => _setText(x0, _toDisplayString(_ctx.msg)))
   return n1
   return n1
 }"
 }"
@@ -62,9 +62,9 @@ export function render(_ctx) {
   const n1 = _child(p1)
   const n1 = _child(p1)
   const p2 = _next(p1)
   const p2 = _next(p1)
   const n2 = _child(p2)
   const n2 = _child(p2)
-  const x0 = _child(n0)
-  const x1 = _child(n1)
-  const x2 = _child(n2)
+  const x0 = _child(n0, -1)
+  const x1 = _child(n1, -1)
+  const x2 = _child(n2, -1)
   _renderEffect(() => {
   _renderEffect(() => {
     const _msg = _ctx.msg
     const _msg = _ctx.msg
     _setText(x0, _toDisplayString(_msg))
     _setText(x0, _toDisplayString(_msg))

+ 10 - 10
packages/compiler-vapor/__tests__/transforms/__snapshots__/vFor.spec.ts.snap

@@ -7,7 +7,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0) => {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value[0] + _for_item0.value.slice(1) + _for_key0.value)))
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value[0] + _for_item0.value.slice(1) + _for_key0.value)))
     return n2
     return n2
   }, ([id, ...other], index) => (id))
   }, ([id, ...other], index) => (id))
@@ -22,7 +22,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0) => {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value[0] + _for_item0.value[1] + _for_key0.value)))
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value[0] + _for_item0.value[1] + _for_key0.value)))
     return n2
     return n2
   }, ([id, other], index) => (id))
   }, ([id, other], index) => (id))
@@ -38,7 +38,7 @@ _delegateEvents("click")
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.items), (_for_item0) => {
   const n0 = _createFor(() => (_ctx.items), (_for_item0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     n2.$evtclick = () => (_ctx.remove(_for_item0.value))
     n2.$evtclick = () => (_ctx.remove(_for_item0.value))
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value)))
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value)))
     return n2
     return n2
@@ -54,7 +54,7 @@ const t0 = _template("<tr> </tr>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.rows), (_for_item0) => {
   const n0 = _createFor(() => (_ctx.rows), (_for_item0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _setText(x2, _toDisplayString(_for_item0.value.id + _for_item0.value.id))
     _setText(x2, _toDisplayString(_for_item0.value.id + _for_item0.value.id))
     return n2
     return n2
   }, (row) => (row.id))
   }, (row) => (row.id))
@@ -90,7 +90,7 @@ export function render(_ctx) {
     _setInsertionState(n5)
     _setInsertionState(n5)
     const n2 = _createFor(() => (_for_item0.value), (_for_item1) => {
     const n2 = _createFor(() => (_for_item0.value), (_for_item1) => {
       const n4 = t0()
       const n4 = t0()
-      const x4 = _child(n4)
+      const x4 = _child(n4, -1)
       _renderEffect(() => _setText(x4, _toDisplayString(_for_item1.value+_for_item0.value)))
       _renderEffect(() => _setText(x4, _toDisplayString(_for_item1.value+_for_item0.value)))
       return n4
       return n4
     }, undefined, 1)
     }, undefined, 1)
@@ -107,7 +107,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0) => {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value.id + _getRestElement(_for_item0.value, ["id"]) + _for_key0.value)))
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value.id + _getRestElement(_for_item0.value, ["id"]) + _for_key0.value)))
     return n2
     return n2
   }, ({ id, ...other }, index) => (id))
   }, ({ id, ...other }, index) => (id))
@@ -122,7 +122,7 @@ const t0 = _template("<span> </span>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.items), (_for_item0) => {
   const n0 = _createFor(() => (_ctx.items), (_for_item0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value.id) + _toDisplayString(_for_item0.value.value)))
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value.id) + _toDisplayString(_for_item0.value.value)))
     return n2
     return n2
   }, ({ id, value }) => (id))
   }, ({ id, value }) => (id))
@@ -137,7 +137,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0, _for_index0) => {
   const n0 = _createFor(() => (_ctx.list), (_for_item0, _for_key0, _for_index0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value + _for_key0.value + _for_index0.value)))
     _renderEffect(() => _setText(x2, _toDisplayString(_for_item0.value + _for_key0.value + _for_index0.value)))
     return n2
     return n2
   }, (value, key, index) => (key))
   }, (value, key, index) => (key))
@@ -153,7 +153,7 @@ export function render(_ctx) {
   let _selector0_0
   let _selector0_0
   const n0 = _createFor(() => (_ctx.rows), (_for_item0) => {
   const n0 = _createFor(() => (_ctx.rows), (_for_item0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _selector0_0(() => {
     _selector0_0(() => {
       _setText(x2, _toDisplayString(_ctx.selected === _for_item0.value.id ? 'danger' : ''))
       _setText(x2, _toDisplayString(_ctx.selected === _for_item0.value.id ? 'danger' : ''))
     })
     })
@@ -227,7 +227,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createFor(() => (_ctx.list), (_for_item0) => {
   const n0 = _createFor(() => (_ctx.list), (_for_item0) => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _renderEffect(() => _setText(x2, _toDisplayString(_getDefaultValue(_for_item0.value.foo, _ctx.bar) + _ctx.bar + _ctx.baz + _getDefaultValue(_for_item0.value.baz[0], _ctx.quux) + _ctx.quux)))
     _renderEffect(() => _setText(x2, _toDisplayString(_getDefaultValue(_for_item0.value.foo, _ctx.bar) + _ctx.bar + _ctx.baz + _getDefaultValue(_for_item0.value.baz[0], _ctx.quux) + _ctx.quux)))
     return n2
     return n2
   })
   })

+ 3 - 3
packages/compiler-vapor/__tests__/transforms/__snapshots__/vIf.spec.ts.snap

@@ -7,7 +7,7 @@ const t0 = _template("<div> </div>", true)
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = _createIf(() => (_ctx.ok), () => {
   const n0 = _createIf(() => (_ctx.ok), () => {
     const n2 = t0()
     const n2 = t0()
-    const x2 = _child(n2)
+    const x2 = _child(n2, -1)
     _renderEffect(() => _setText(x2, _toDisplayString(_ctx.msg)))
     _renderEffect(() => _setText(x2, _toDisplayString(_ctx.msg)))
     return n2
     return n2
   })
   })
@@ -38,7 +38,7 @@ export function render(_ctx) {
     return [n10, n11]
     return [n10, n11]
   }, null, true))
   }, null, true))
   const n13 = t5()
   const n13 = t5()
-  const x13 = _child(n13)
+  const x13 = _child(n13, -1)
   _renderEffect(() => _setText(x13, _toDisplayString(_ctx.text)))
   _renderEffect(() => _setText(x13, _toDisplayString(_ctx.text)))
   return [n0, n13]
   return [n0, n13]
 }"
 }"
@@ -72,7 +72,7 @@ export function render(_ctx) {
     const n2 = t0()
     const n2 = t0()
     const n3 = t1()
     const n3 = t1()
     const n4 = t2()
     const n4 = t2()
-    const x4 = _child(n4)
+    const x4 = _child(n4, -1)
     _renderEffect(() => _setText(x4, _toDisplayString(_ctx.msg)))
     _renderEffect(() => _setText(x4, _toDisplayString(_ctx.msg)))
     return [n2, n3, n4]
     return [n2, n3, n4]
   })
   })

+ 2 - 2
packages/compiler-vapor/__tests__/transforms/__snapshots__/vText.spec.ts.snap

@@ -6,7 +6,7 @@ const t0 = _template("<div> </div>", true)
 
 
 export function render(_ctx, $props, $emit, $attrs, $slots) {
 export function render(_ctx, $props, $emit, $attrs, $slots) {
   const n0 = t0()
   const n0 = t0()
-  const x0 = _child(n0)
+  const x0 = _child(n0, -1)
   _renderEffect(() => _setText(x0, _toDisplayString(_ctx.str)))
   _renderEffect(() => _setText(x0, _toDisplayString(_ctx.str)))
   return n0
   return n0
 }"
 }"
@@ -18,7 +18,7 @@ const t0 = _template("<div> </div>", true)
 
 
 export function render(_ctx) {
 export function render(_ctx) {
   const n0 = t0()
   const n0 = t0()
-  const x0 = _child(n0)
+  const x0 = _child(n0, -1)
   _renderEffect(() => _setText(x0, _toDisplayString(_ctx.test)))
   _renderEffect(() => _setText(x0, _toDisplayString(_ctx.test)))
   return n0
   return n0
 }"
 }"