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"
|
||||
|
||||
async function getJson(url) {
|
||||
let obj = await fetch(url)
|
||||
let txt = await obj.text()
|
||||
let json = JSON.parse(txt)
|
||||
return json
|
||||
}
|
||||
|
||||
let db2 = getJson(jsonurl)
|
||||
|
||||
var jdb
|
||||
|
||||
fetch(jsonurl)
|
||||
.then(result => result.json())
|
||||
.then((output) => {
|
||||
let jdb = output;
|
||||
|
||||
}).catch(err => console.error(err));
|
||||
|
||||
|
||||
.then(res => res.json())
|
||||
.then(data => jdb = data)
|
||||
|
||||
let vm = new Vue({
|
||||
el: '#root',
|
||||
|
|
Loading…
Reference in New Issue