I would like to change the color of a button when clicked. I have two buttons. When one button is clicked, it assigns variable "host", when the other button is clicked, it assigns variable "guest".
<v-btn color="primary" fab large
@click="type='host'">
<v-icon>home</v-icon><br/>Host
</v-btn>
<v-btn color="secondary" fab large
@click="type='guest'">
<v-icon>person</v-icon><br/>Request
</v-btn>
I've tried the following:
- colon shorthand
<v-btn v-bind:style="{ color: type==='host' ? 'secondary' : 'primary' }>
<v-icon>home</v-icon>
HOST
</v-btn>
AND
<v-btn v-bind:color="{ type==='guest' ? 'secondary' : 'primary' }>
<v-icon>person</v-icon><br/>
Request
</v-btn>
but neither works
v-btn-toggledoesn't do the job and doesn't have the styles we want (which is a circle)
I'm a newby in vue.js and don't know how to debug this. Any help would be greatly appreciated!