File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
packages/macros/src/volar Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -83,18 +83,21 @@ export function transformJsxMacros(
8383 codes ,
8484 node . getStart ( ast ) ,
8585 node . expression . getStart ( ast ) ,
86- `return {\nprops: {} as { ${ props . join ( ', ' ) } }` ,
87- `,\nslots: {} as ${ map . defineSlots ?? '{}' } ` ,
88- `,\nexpose: (exposed: import('vue').ShallowUnwrapRef<${ map . defineExpose ?? '{}' } >) => {}` ,
89- `,\nrender: ` ,
86+ `const ${ HELPER_PREFIX } render = ` ,
9087 shouldWrapByCall ? '(' : '' ,
9188 )
9289 replaceRange (
9390 codes ,
9491 node . expression . end ,
9592 node . expression . end ,
9693 shouldWrapByCall ? ')()' : '' ,
97- `\n}` ,
94+ `
95+ return {
96+ props: {} as {${ props . join ( ', ' ) } },
97+ slots: {} as ${ map . defineSlots ?? '{}' } ,
98+ expose: (exposed: import('vue').ShallowUnwrapRef<${ map . defineExpose ?? '{}' } >) => {},
99+ render: ${ HELPER_PREFIX } render,
100+ }` ,
98101 )
99102 }
100103 } )
You can’t perform that action at this time.
0 commit comments