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(
83
83
codes ,
84
84
node . getStart ( ast ) ,
85
85
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 = ` ,
90
87
shouldWrapByCall ? '(' : '' ,
91
88
)
92
89
replaceRange (
93
90
codes ,
94
91
node . expression . end ,
95
92
node . expression . end ,
96
93
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
+ }` ,
98
101
)
99
102
}
100
103
} )
You can’t perform that action at this time.
0 commit comments