Skip to content

Commit a951a73

Browse files
committed
chore: minor tweaks
1 parent 0d8e0d5 commit a951a73

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Diff for: packages/compiler-vapor/__tests__/transforms/__snapshots__/transformElement.spec.ts.snap

+7-8
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,14 @@ export function render(_ctx) {
179179
`;
180180

181181
exports[`compiler: element transform > component > v-for on component should not mark as single root 1`] = `
182-
"import { resolveComponent as _resolveComponent, setInsertionState as _setInsertionState, createComponentWithFallback as _createComponentWithFallback, template as _template } from 'vue';
183-
const t0 = _template("<template></template>", true)
182+
"import { createComponent as _createComponent, createFor as _createFor } from 'vue';
184183
185-
export function render(_ctx) {
186-
const _component_Comp = _resolveComponent("Comp")
187-
const n1 = t0()
188-
_setInsertionState(n1)
189-
const n0 = _createComponentWithFallback(_component_Comp)
190-
return n1
184+
export function render(_ctx, $props, $emit, $attrs, $slots) {
185+
const n0 = _createFor(() => (_ctx.items), (_for_item0) => {
186+
const n2 = _createComponent(_ctx.Comp)
187+
return n2
188+
}, (item) => (item), 2)
189+
return n0
191190
}"
192191
`;
193192

Diff for: packages/compiler-vapor/__tests__/transforms/transformElement.spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import {
1717

1818
const compileWithElementTransform = makeCompile({
1919
nodeTransforms: [
20+
transformVFor,
2021
transformElement,
2122
transformChildren,
2223
transformText,
23-
transformVFor,
2424
],
2525
directiveTransforms: {
2626
bind: transformVBind,
@@ -182,7 +182,8 @@ describe('compiler: element transform', () => {
182182
bindingMetadata: { Comp: BindingTypes.SETUP_CONST },
183183
},
184184
)
185-
expect(code).not.contains('_createComponent(_ctx.Comp, null, null, true)')
185+
expect(code).toMatchSnapshot()
186+
expect(code).contains('_createComponent(_ctx.Comp)')
186187
})
187188

188189
test('static props', () => {

0 commit comments

Comments
 (0)