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

Add icons dynamically #7

Closed
alvarosabu opened this issue Jan 13, 2021 · 5 comments
Closed

Add icons dynamically #7

alvarosabu opened this issue Jan 13, 2021 · 5 comments

Comments

@alvarosabu
Copy link
Contributor

alvarosabu commented Jan 13, 2021

Hi, awesome work with this plugins man, enjoying a lot playing around with vueuse and this one.

Which would be the approach to dynamically insert icons? Let's say I have a menu metadata in a js object and icon is one of the properties.

One option I guess would be to use <component :is="menuitem.icon"> where icon: IconAccountBox .

Would make sense to add a component <icon :name="carbon-icon" /> to the repo?

@antfu
Copy link
Member

antfu commented Jan 13, 2021

#5, you can use https://github.com/antfu/purge-icons for dynamic loading and this for statical bunding. Guess I should update the README about this 😅

@alvarosabu
Copy link
Contributor Author

I could also check if there was one opened already haha, but it will help yes hehe. Thanks

@antfu
Copy link
Member

antfu commented Jan 13, 2021

But yeah, maybe we could have a configure to bundle all the icons in a collection (but that's what I am trying to solve here 😅). You can give it a shot if that makes sense to you, I will help for sure :)

@antfu
Copy link
Member

antfu commented Jan 13, 2021

Made an issue to track on that.

This was referenced Jan 17, 2021
@husayt
Copy link

husayt commented Jan 18, 2022

#5, you can use https://github.com/antfu/purge-icons for dynamic loading and this for statical bunding. Guess I should update the README about this 😅

@antfu with custom loader I guess we can achieve dynamic loading here too now.

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