本白在react native中使用fetch进行网络请求的时候显示请求失败。
请求部分代码如下:
fetch('../data/myjson.json')
.then(function(response){
return response.json();
}).then(function(json){
console.log('parsed json', json);
}).catch(function(ex){
console.log('parsing failed')
});../data/myjson.json是我的本地json文件
Thanks for all helps
慕田峪9158850
慕少森
饮歌长啸
随时随地看视频慕课网APP