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 a generic icon component #8

Open
remiguittaut opened this issue Nov 28, 2022 · 2 comments
Open

Add a generic icon component #8

remiguittaut opened this issue Nov 28, 2022 · 2 comments

Comments

@remiguittaut
Copy link

remiguittaut commented Nov 28, 2022

It would be useful to create a generic icon component with an icon prop, so we could directly set the icon without duplicating the control, like with bootstrap-vue:

Instead of

<b-chevron-up v-if="expanded" />
<b-chevron-down v-if="!expanded" />

We could write

<b-icon :icon="expanded ? 'b-chevron-up' : 'b-chevron-down'" />
@alcalyn
Copy link

alcalyn commented Jan 8, 2024

Also need this. Not sure however how it will be handled by tree shaking.
I use this lib mainly for bundle size optimization, because it will bundle only icons I use.

@alcalyn
Copy link

alcalyn commented Jan 8, 2024

Ok, actually I found you can achieve this by doing:

import { BIconChevronUp, BIconChevronDown } from 'bootstrap-icons-vue';
<component :is="expanded ? BIconChevronUp : BIconChevronDown" />

And I am sure only these two icons needs to be bundled.

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

2 participants