Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to create a dynamic list of icons #189

Closed
mod7ex opened this issue Apr 14, 2022 · 3 comments
Closed

how to create a dynamic list of icons #189

mod7ex opened this issue Apr 14, 2022 · 3 comments

Comments

@mod7ex
Copy link

mod7ex commented Apr 14, 2022

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

@userquin
Copy link
Member

userquin commented Apr 14, 2022

@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

@serfend
Copy link

serfend commented May 6, 2022

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

@serfend
Copy link

serfend commented May 6, 2022

NOT SUPPORT THIS WAY for there is no way to infer a component from a dynamic string

@mod7ex mod7ex closed this as completed May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants