为了账号安全,请及时绑定邮箱和手机立即绑定

this.$http.get("data/cartData.json").then()获取json数据出错

https://img1.sycdn.imooc.com//5d5506120001d81714630146.jpg

       cartView: function() {

           var _this = this;

           this.$http.get("data/cartData.json").then(function(res) {

                   _this.productList = res.body.result.list;

               }).catch(function(res) {

                   console.log(res);

               })

       }


正在回答

1 回答

_this.productList = res.body.result.productList;


0 回复 有任何疑惑可以回复我~
#1

慕粉18838982105 提问者

谢谢!已经解决了,需要用http协议。
2019-08-17 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
使用vue2.0实现购物车和地址选配功能
  • 参与学习       96921    人
  • 解答问题       445    个

本视频教程结合案例完整贯穿各个知识点,轻松玩转vue2.0框架

进入课程

this.$http.get("data/cartData.json").then()获取json数据出错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信