try computed
This commit is contained in:
parent
cb014d7869
commit
847796c173
Binary file not shown.
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue