It appears that you are looking for a feature similar to a radio button group, where selecting one option reverts the color of the other.
To achieve this, the buttons must have shared state.
The implementation of sharing this state can vary, but in this instance, I recommend storing it in the parent component. The state could be managed using either the composition API or options API, with options possibly being more suitable depending on experience level.
<script>
export default {
data() {
return {
selected: 0
}
},
}
</script>
<template>
<button :class="{red:selected == 1}" @click="selected = 1">
Button 1
</button>
<button :class="{red:selected == 2}" @click="selected = 2">
Button 2
</button>
</template>
<style>
.red{
background: red;
}
</style>
example in vue SFC playground