【发布时间】:2018-06-12 02:30:26
【问题描述】:
我正在提交投票申请。单击投票按钮后,我想禁用该按钮。如何禁用按钮。
模板
<v-btn
v-for="choice in data.choices"
@click="doVote(choice.id)"
color="success"
v-bind:key="choice.id">
votes: {{ choice.votes }}
</v-btn>
脚本
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()
},
【问题讨论】:
标签: javascript vue.js vuetify.js