I'm trying to make a clickable "star" icon using font-awesome with bulma, switching between regular and solid styles (fas and far) in Vue, to achieve this I have the following component:
<template>
<span v-if="isStarred" class="icon starred config-icon clickable-text" @click="unstar">
<i class="far fa-star" title="Unstar Ranking"/>
</span>
<span v-else class="icon unstarred config-icon clickable-text" @click="star">
<i class="fas fa-star" title="Star Ranking"/>
</span>
</template>
The value isStarred
is being updated properly and the span elements are updating accordingly. However the i
element with the icon doesn't update until I fully reload the page.
I was able to make this work with v-show
instead of v-if
but I don't understand why this wouldn't work.