fetch fix?
This commit is contained in:
parent
3852122e55
commit
4fe668fccb
Binary file not shown.
|
@ -44,24 +44,11 @@ Vue.component('Accordeon', {
|
||||||
|
|
||||||
const jsonurl = "https://ed.brz9.dev/proj/map/asset/json/db.json"
|
const jsonurl = "https://ed.brz9.dev/proj/map/asset/json/db.json"
|
||||||
|
|
||||||
async function getJson(url) {
|
var jdb
|
||||||
let obj = await fetch(url)
|
|
||||||
let txt = await obj.text()
|
|
||||||
let json = JSON.parse(txt)
|
|
||||||
return json
|
|
||||||
}
|
|
||||||
|
|
||||||
let db2 = getJson(jsonurl)
|
|
||||||
|
|
||||||
|
|
||||||
fetch(jsonurl)
|
fetch(jsonurl)
|
||||||
.then(result => result.json())
|
.then(res => res.json())
|
||||||
.then((output) => {
|
.then(data => jdb = data)
|
||||||
let jdb = output;
|
|
||||||
|
|
||||||
}).catch(err => console.error(err));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let vm = new Vue({
|
let vm = new Vue({
|
||||||
el: '#root',
|
el: '#root',
|
||||||
|
|
Loading…
Reference in New Issue