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

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

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

慕粉18838982105 2019-08-15 15:21:31
       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 回答

已采纳
?
橋本奈奈未

TA贡献436条经验 获得超108个赞

协议,你的文件是用file协议打开的, 需要用http协议。一般编辑器都会支持创建一个http服务的。

查看完整回答
1 反对 回复 2019-08-15
  • 1 回答
  • 0 关注
  • 868 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信