Closed dev-vinicius-andrade closed 1 year ago
any news regarding it?
I have got the same problem
{{ menu.meta.title }} It's not effect
would be very nice having this feature
Currently that auto-imports doesn't work with dynamic components, my workaround was to explicitly import dynamically used icons:
<template>
<Component :is="component" />
</template>
<script setup>
import IconTablerHome from '~icons/tabler/smart-home'
import IconTablerListDetails from '~icons/tabler/list-details'
import IconTablerGift from '~icons/tabler/gift'
const props = defineProps({
name: String,
set: {
type: String,
default: 'tabler',
},
})
const icons = {
'tabler-home': IconTablerHome,
'tabler-list-details': IconTablerListDetails,
'tabler-gift': IconTablerGift,
}
const component = computed(() => icons[`${props.set}-${props.name}`])
</script>
https://github.com/antfu/unplugin-icons/issues/5#issuecomment-1005887483
Please search for existing issues before creating one.
Describe the bug
I'm currently using the plugin and now I need to create some components dynamically.
In my vite.config.ts I've the following configuration
This allows me to use the component like
But currently i need to make it work more dynamicaly, like:
But I can't get it to work. Is it possible?
Other thing is that i can't change the icons properties using :width and :height
Reproduction
Dynamicaly create icons based on a list of iconNames
System Info
Used Package Manager
npm
Validations