Skip to content

Commit

Permalink
feat(vue3): allow passing components as props without reactivity over…
Browse files Browse the repository at this point in the history
…head (#366)
  • Loading branch information
brc-dd authored Jul 17, 2024
1 parent 561d08c commit 02b805d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/compilers/vue3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ export const Vue3Compiler = (async (svg: string, collection: string, icon: strin
filename: `${collection}-${icon}.vue`,
})

code = `import { markRaw } from 'vue'\n${code}`
code = code.replace(/^export /gm, '')
code += `\n\nexport default { name: '${collection}-${icon}', render${injectScripts ? `, data() {${injectScripts};return { idMap }}` : ''} }`
code += `\n\nexport default markRaw({ name: '${collection}-${icon}', render${
injectScripts ? `, data() {${injectScripts};return { idMap }}` : ''
} })`
code += '\n/* vite-plugin-components disabled */'

return code
Expand Down

0 comments on commit 02b805d

Please sign in to comment.