|
|
@@ -1,18 +1,15 @@
|
|
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
|
|
|
|
exports[`compiler: v-for > array de-structured value 1`] = `
|
|
|
-"import { renderEffect as _renderEffect, setText as _setText, createFor as _createFor, template as _template } from 'vue/vapor';
|
|
|
+"import { renderEffect as _renderEffect, setText as _setText, withDestructure as _withDestructure, createFor as _createFor, template as _template } from 'vue/vapor';
|
|
|
const t0 = _template("<div></div>")
|
|
|
|
|
|
export function render(_ctx) {
|
|
|
- const n0 = _createFor(() => (_ctx.list), (_ctx0) => {
|
|
|
+ const n0 = _createFor(() => (_ctx.list), _withDestructure((_state, [[id, ...other], index] = _state) => [id, other, index], (_ctx0) => {
|
|
|
const n2 = t0()
|
|
|
_renderEffect(() => _setText(n2, _ctx0[0] + _ctx0[1] + _ctx0[2]))
|
|
|
return n2
|
|
|
- }, ([id, ...other], index) => (id), null, null, false, _state => {
|
|
|
- const [[id, ...other], index] = _state
|
|
|
- return [id, other, index]
|
|
|
- })
|
|
|
+ }), ([id, ...other], index) => (id))
|
|
|
return n0
|
|
|
}"
|
|
|
`;
|
|
|
@@ -69,35 +66,29 @@ export function render(_ctx) {
|
|
|
`;
|
|
|
|
|
|
exports[`compiler: v-for > object de-structured value 1`] = `
|
|
|
-"import { renderEffect as _renderEffect, setText as _setText, createFor as _createFor, template as _template } from 'vue/vapor';
|
|
|
+"import { renderEffect as _renderEffect, setText as _setText, withDestructure as _withDestructure, createFor as _createFor, template as _template } from 'vue/vapor';
|
|
|
const t0 = _template("<div></div>")
|
|
|
|
|
|
export function render(_ctx) {
|
|
|
- const n0 = _createFor(() => (_ctx.list), (_ctx0) => {
|
|
|
+ const n0 = _createFor(() => (_ctx.list), _withDestructure((_state, [{ id, ...other }, index] = _state) => [id, other, index], (_ctx0) => {
|
|
|
const n2 = t0()
|
|
|
_renderEffect(() => _setText(n2, _ctx0[0] + _ctx0[1] + _ctx0[2]))
|
|
|
return n2
|
|
|
- }, ({ id, ...other }, index) => (id), null, null, false, _state => {
|
|
|
- const [{ id, ...other }, index] = _state
|
|
|
- return [id, other, index]
|
|
|
- })
|
|
|
+ }), ({ id, ...other }, index) => (id))
|
|
|
return n0
|
|
|
}"
|
|
|
`;
|
|
|
|
|
|
exports[`compiler: v-for > v-for aliases w/ complex expressions 1`] = `
|
|
|
-"import { renderEffect as _renderEffect, setText as _setText, createFor as _createFor, template as _template } from 'vue/vapor';
|
|
|
+"import { renderEffect as _renderEffect, setText as _setText, withDestructure as _withDestructure, createFor as _createFor, template as _template } from 'vue/vapor';
|
|
|
const t0 = _template("<div></div>")
|
|
|
|
|
|
export function render(_ctx) {
|
|
|
- const n0 = _createFor(() => (_ctx.list), (_ctx0) => {
|
|
|
+ const n0 = _createFor(() => (_ctx.list), _withDestructure((_state, [{ foo = bar, baz: [qux = quux] }] = _state) => [foo, qux], (_ctx0) => {
|
|
|
const n2 = t0()
|
|
|
_renderEffect(() => _setText(n2, _ctx0[0] + _ctx.bar + _ctx.baz + _ctx0[1] + _ctx.quux))
|
|
|
return n2
|
|
|
- }, null, null, null, false, _state => {
|
|
|
- const [{ foo = bar, baz: [qux = quux] }] = _state
|
|
|
- return [foo, qux]
|
|
|
- })
|
|
|
+ }))
|
|
|
return n0
|
|
|
}"
|
|
|
`;
|