Closed chioio closed 1 year ago
Custom collection: app File path: /assets/icons/trash.svg
app
/assets/icons/trash.svg
Render function
export const renderIcon = ( icon: string, props: Record<string, unknown> = { size: 20 } ) => h(Icon, { icon, width: props.size, height: props.size, ...props })
Error produce
const a = { icon: () => renderIcon('app:trash') }
! But success using in template like <i-app:trash />
<i-app:trash />
None
System: OS: macOS 12.6 CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz Memory: 1.37 GB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 14.19.2 - ~/Library/Caches/fnm_multishells/25267_1653168489651/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 6.14.17 - ~/Library/Caches/fnm_multishells/25267_1653168489651/bin/npm
pnpm
If you mean to use with unplugin-vue-components, it works by static replacement. Which your runtime approach would not work.
unplugin-vue-components
Describe the bug
Custom collection:
app
File path:/assets/icons/trash.svg
Render function
Error produce
! But success using in template like
<i-app:trash />
Reproduction
None
System Info
Used Package Manager
pnpm
Validations