📜  json fetch 数据不显示 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:19.635000             🧑  作者: Mango

代码示例1
// if your json data doesn't show then just replace this code. 
handleGetJson = () =>{
  fetch(`./data.json`, {
      headers : { 
        'Content-Type': 'application/json',
        'Accept': 'application/json'
       }
    })
     .then(res=> res.json())
     .then(data=> console.log(data))
}