try computed

This commit is contained in:
ed barz 2022-05-15 00:42:29 +02:00
parent cb014d7869
commit 847796c173
2 changed files with 12 additions and 1 deletions

Binary file not shown.

View File

@ -52,9 +52,20 @@ fetch(jsonurl)
let vm = new Vue({ let vm = new Vue({
el: '#root', el: '#root',
computed : {
db: function () {
const jsonurl = "https://ed.brz9.dev/proj/map/asset/json/db.json"
let jdb
fetch(jsonurl)
.then(res => res.json())
.then(data => jdb = data)
return jdb
},
},
data: { data: {
currentLang: 'fr', currentLang: 'fr',
db : jdb.db,
db2 : { db2 : {
restaurants : { restaurants : {
id : "resto", id : "resto",