This is the shortest distance to done.
See it in action - https://codepen.io/stephanieschellin/pen/WaZvPR
HTML
<div id="app">
<button
v-bind:class="{ 'i-am-active': button_active_state }"
v-on:click="button_active_state = !button_active_state"
name="button"
>START</button>
</div>
JS
new Vue({
el: '#app',
data: {
button_active_state: false
}
});
CSS
.i-am-active {
color: orange;
}
Explanation
In Vuejs if your data variable is Boolean using true/false you can leverage the ! modifier to toggle its value between true and false.
v-on:click="button_active_state = !button_active_state"
This allows you to avoid having call a method to perform the conditional check and modify the true/false value. Everything needed to toggle the value is baked into Vue.
For a more in depth example see - https://www.tutorialsplane.com/vue-js-toggle-class-click/