Skip to content

Commit a13cfbd

Browse files
TimZhang2090sxzz
andauthoredNov 16, 2023
refactor(plugin-vue-jsx): improve the readability (#289)
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
1 parent c316d43 commit a13cfbd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎packages/plugin-vue-jsx/src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,11 @@ function vueJsxPlugin(options: Options = {}): Plugin {
222222
callbackCode += `\n__VUE_HMR_RUNTIME__.reload("${id}", __${exported})`
223223
}
224224

225-
code += `\nimport.meta.hot.accept(({${hotComponents
225+
const newCompNames = hotComponents
226226
.map((c) => `${c.exported}: __${c.exported}`)
227-
.join(',')}}) => {${callbackCode}\n})`
227+
.join(',')
228228

229+
code += `\nimport.meta.hot.accept(({${newCompNames}}) => {${callbackCode}\n})`
229230
result.code = code
230231
}
231232

0 commit comments

Comments
 (0)
Please sign in to comment.