mounted() {
axios.post('/api/answer/'+ this.answer + '/votes/users').then(response =>{
this.voted = response.data.voted
})
},
data() {
return {
voted: false,
voted_count: this.count
}
},
它会先显示voted:false(白色按钮未投票),mounted请求完后把请求的voted赋值给this.voted true(请求完后才会显示蓝色按钮已投票)