how to create a dynamic list of icons
mod7ex opened this issue · comments
How to print a list of icons just from an array for example [{ name: "edit" }, { name: "settings" }]
and i get
<i-mdi-edit />
<i-mdi-settings />
and in the browser it really renders the wanted icon
@modex98 you can try import.meta.glob
or import.meta.globEager
using raw
option, but you'll need to use some directive to render the svg icon, check the raw option on readme
when i use import.meta.glob
or import.meta.globEager
its warn that [plugin:vite:import-analysis] Invalid glob import syntax: pattern must start with "." or "/" (relative to project root) or alias path
NOT SUPPORT THIS WAY for there is no way to infer a component from a dynamic string