|
1 | 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
2 | 2 |
|
3 | 3 | exports[`compiler: v-for > array de-structured value 1`] = `
|
4 |
| -"import { renderEffect as _renderEffect, setText as _setText, createFor as _createFor, template as _template } from 'vue/vapor'; |
| 4 | +"import { renderEffect as _renderEffect, setText as _setText, withDestructure as _withDestructure, createFor as _createFor, template as _template } from 'vue/vapor'; |
5 | 5 | const t0 = _template("<div></div>")
|
6 | 6 |
|
7 | 7 | export function render(_ctx) {
|
8 |
| - const n0 = _createFor(() => (_ctx.list), (_ctx0) => { |
| 8 | + const n0 = _createFor(() => (_ctx.list), _withDestructure((_state, [[id, ...other], index] = _state) => [id, other, index], (_ctx0) => { |
9 | 9 | const n2 = t0()
|
10 | 10 | _renderEffect(() => _setText(n2, _ctx0[0] + _ctx0[1] + _ctx0[2]))
|
11 | 11 | return n2
|
12 |
| - }, ([id, ...other], index) => (id), null, null, false, _state => { |
13 |
| - const [[id, ...other], index] = _state |
14 |
| - return [id, other, index] |
15 |
| - }) |
| 12 | + }), ([id, ...other], index) => (id)) |
16 | 13 | return n0
|
17 | 14 | }"
|
18 | 15 | `;
|
@@ -69,35 +66,29 @@ export function render(_ctx) {
|
69 | 66 | `;
|
70 | 67 |
|
71 | 68 | exports[`compiler: v-for > object de-structured value 1`] = `
|
72 |
| -"import { renderEffect as _renderEffect, setText as _setText, createFor as _createFor, template as _template } from 'vue/vapor'; |
| 69 | +"import { renderEffect as _renderEffect, setText as _setText, withDestructure as _withDestructure, createFor as _createFor, template as _template } from 'vue/vapor'; |
73 | 70 | const t0 = _template("<div></div>")
|
74 | 71 |
|
75 | 72 | export function render(_ctx) {
|
76 |
| - const n0 = _createFor(() => (_ctx.list), (_ctx0) => { |
| 73 | + const n0 = _createFor(() => (_ctx.list), _withDestructure((_state, [{ id, ...other }, index] = _state) => [id, other, index], (_ctx0) => { |
77 | 74 | const n2 = t0()
|
78 | 75 | _renderEffect(() => _setText(n2, _ctx0[0] + _ctx0[1] + _ctx0[2]))
|
79 | 76 | return n2
|
80 |
| - }, ({ id, ...other }, index) => (id), null, null, false, _state => { |
81 |
| - const [{ id, ...other }, index] = _state |
82 |
| - return [id, other, index] |
83 |
| - }) |
| 77 | + }), ({ id, ...other }, index) => (id)) |
84 | 78 | return n0
|
85 | 79 | }"
|
86 | 80 | `;
|
87 | 81 |
|
88 | 82 | exports[`compiler: v-for > v-for aliases w/ complex expressions 1`] = `
|
89 |
| -"import { renderEffect as _renderEffect, setText as _setText, createFor as _createFor, template as _template } from 'vue/vapor'; |
| 83 | +"import { renderEffect as _renderEffect, setText as _setText, withDestructure as _withDestructure, createFor as _createFor, template as _template } from 'vue/vapor'; |
90 | 84 | const t0 = _template("<div></div>")
|
91 | 85 |
|
92 | 86 | export function render(_ctx) {
|
93 |
| - const n0 = _createFor(() => (_ctx.list), (_ctx0) => { |
| 87 | + const n0 = _createFor(() => (_ctx.list), _withDestructure((_state, [{ foo = bar, baz: [qux = quux] }] = _state) => [foo, qux], (_ctx0) => { |
94 | 88 | const n2 = t0()
|
95 | 89 | _renderEffect(() => _setText(n2, _ctx0[0] + _ctx.bar + _ctx.baz + _ctx0[1] + _ctx.quux))
|
96 | 90 | return n2
|
97 |
| - }, null, null, null, false, _state => { |
98 |
| - const [{ foo = bar, baz: [qux = quux] }] = _state |
99 |
| - return [foo, qux] |
100 |
| - }) |
| 91 | + })) |
101 | 92 | return n0
|
102 | 93 | }"
|
103 | 94 | `;
|
|
0 commit comments