Javascript – Die Daten werden nicht aktualisiert, nachdem die aktuelle Seite mit „Gefällt mir' markiert wurde. Sie werden nach dem Aktualisieren aktualisiert.
某草草
某草草 2017-05-19 10:16:01
0
4
492
zan:function (n){
                        this.$http({
                            url:URL,
                            data:{
                                act:'acc',
                                id:n
                            }
                        }).then(function(res){
                                 //这里怎么写,大胸弟....
                        });

                    },

某草草
某草草

Antworte allen(4)
洪涛

点击之后改变显示的数字不就完了,用的变量就变量的数字+1

巴扎黑

点击事件后 在数字加一 然后 更改页面的显示数字 要不你少写了 要不你写的顺序有问题

Peter_Zhu

点击之后通过 ajax 发送点赞请求,如果请求成功就更新点赞的数字,请求失败就提示“点赞失败”,数字不变。

洪涛
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
                                 }
                        });

                    }
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage