axios里面使用JSON.parse()报错,因为JSON数据有错
getData(){var that= this;// 获取json数据来渲染组件this.axios.get("/static/json/quality.json").then(function(res){// console.log(res.data)that.quality = res.data;let a = JSON.parse(...
·
getData(){
var that = this;
// 获取json数据来渲染组件
this.axios.get("/static/json/quality.json")
.then(function(res){
// console.log(res.data)
that.quality = res.data;
let a = JSON.parse(res.data)
console.log(a)
})
.catch(function(){
console.log("wrong")
})
}
更多推荐
已为社区贡献1条内容
所有评论(0)