Hey there, I'm having trouble changing my icon on click and I can't figure out why. Here's the template I'm using:
<button>
<ion-icon class="marge-image" :icon="onChange ? heart : heartOutline" @click="onChange = !onChange"></ion-icon>
</button>
And here's the script where I set onChange to false and imported my icons (which display correctly except when I try to change the icon on click):
import { heart, heartOutline } from "ionicons/icons";
export default defineComponent({
components: {
IonLabel,
IonAvatar,
IonGrid,
IonIcon,
IonCol,
IonRow,
},
setup() {
return { displayDate , heart, heartOutline, onChange: false };
},
});