zan:function (n){
this.$http({
url:URL,
data:{
act:'acc',
id:n
}
}).then(function(res){
//这里怎么写,大胸弟....
});
},
PHP中文网2017-05-19 10:18:01
After clicking, it’s not enough to change the displayed number. The variable used is the variable number + 1
巴扎黑2017-05-19 10:18:01
After the click event, add one to the number and then change the displayed number on the page. Either you write less or there is something wrong with the order of your writing
天蓬老师2017-05-19 10:18:01
After clicking, send a like request through ajax. If the request is successful, the number of likes will be updated. If the request fails, "Like Failed" will be displayed and the number will remain unchanged.
PHP中文网2017-05-19 10:18:01
zan:function (n){
this.$http({
url:URL,
data:{
act:'acc',
id:n
}
}).then(function(res){
//这里怎么写,大胸弟....
if(res.status === xx){
// vm.num 你绑定的数据 直接赋值 vm.num = res.data
}
});
}