Struggling to find a solution for toggling through 4 states of button classes. I've attempted to modify some code related to "isFollowing" without success. The goal is to toggle between an off state and 3 different colors.
<button v-on:click="market(p)"
v-bind:class="p.isFollowing ? following : not-following"></button>
methods: {
market: async function (symbol) {
if (symbol.isFollowing){
} else {
//send post
}
this.symbol.forEach(u => {
if (u.symbol == symbol.symbol) {
const id = symbol.symbol
u.symbol = "TEMP"
u.isFollowing = !u.isFollowing
u.symbol = id
}
})
}
}
//still struggling with this:
<button v-on:click="market(p)"
v-bind:class="['marketButton', { 'marketButtonOff': p.marketOff, 'marketButtonGreen': p.marketGreen, 'marketButtonYellow': p.marketYellow, 'marketButtonRed': p.marketRed }]
"></button>