I'm using this function
obtenerCursos:async function(){
const data = await fetch('cursos.json', {mode: 'no-cors'});
const cursos = await data.json();
commit('llenarCursos',cursos)
}
I try to get data from local json file:
[
{"nombre":"item1", "id":1},
{"nombre":"item2", "id":2},
{"nombre":"item3", "id":3}
]
But I'm not getting json data I get a object
Response
?
body: null
?
bodyUsed: false
?
headers: Headers
?
ok: false
?
redirected: false
?
status: 0
?
statusText: ""
?
type: "opaque"
?
url: ""
I'm not sure about what I'm doing wrong
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…