data() {
return {
isActive: true
}
},
methods: {
setActiveBtn: function () {
this.isActive = !this.isActive
}
}
}
<template>
<div class="btn-topbox">
<button
class="btn btn1"
@click=" setActiveBtn()"
:class="{ active: isActive }">Limit</button>
<button class="btn btn2"
@click=" setActiveBtn()"
:class="{ active: !isActive }">Market</button>
</div>
</template>