[Vuejs]-How can I change value according to icon(with it's class) that was clicked in Vue?

0๐Ÿ‘

โœ…

So in the click handler you can pass the status to $emit:

<i v-on:click="$emit('main-handle', data.status)" ...>

In the listener for the main-handle event this will be accessible as $event:

<MainPage v-on:main-handle="handler(loadGeneralQuestInfo, loadFinishedQuestleafs, $event)" ...>

In the method handler you can then set isActive based on the status.

There are various other ways you might do this, such as using 3 separate events.

Leave a comment