I need assistance with my voting application. I am looking to implement a feature that disables the voting button after it has been clicked. Can someone provide guidance on how to achieve this?
template
<v-btn
v-for="choice in data.choices"
@click="doVote(choice.id)"
color="success"
v-bind:key="choice.id">
votes: {{ choice.votes }}
</v-btn>
script
data () {
return {
vote: null,
questions: [],
}
},
methods: {
fetchData () {
this.$request.questions.list().then(res => {
this.questions = res.data.results
})
},
// add votes
doVote (vote) {
if (!vote) {
return
}
this.$request.questions.vote(vote).then(res => {
this.fetchData()
})
},
mounted () {
this.fetchData()
},