antfu / purge-icons

🎐 Bundles icons on demand
https://www.npmjs.com/package/purge-icons
MIT License
228 stars 18 forks source link

[Feature request] Vue component plugin #4

Closed ycs77 closed 4 years ago

antfu commented 4 years ago

Can you provide some details about your request?

ycs77 commented 4 years ago

The problem I have now is when I use v-model to change icon, it will not working:

<span class="iconify" :data-icon="show ? 'heroicons-outline:check-circle' : 'heroicons-outline:x-circle'"></span>

<input type="checkbox" v-model="show">

It seems that the reason for iconify makes Vue unable to work. May I use the following component to wrap <span class="iconify" data-icon="..."></span>? Or is there a better solution?

<Icon :icon="show ? 'heroicons-outline:check-circle' : 'heroicons-outline:x-circle'" />
antfu commented 4 years ago

https://www.github.com/antfu/vitesse/tree/master/src%2Fcomponents%2FIcon.vue

check out this.

ycs77 commented 4 years ago

Thanks