try with method
This commit is contained in:
parent
e0f123a0d7
commit
9d7529b1c5
Binary file not shown.
|
@ -52,20 +52,10 @@ fetch(jsonurl)
|
|||
|
||||
let vm = new Vue({
|
||||
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: {
|
||||
currentLang: 'fr',
|
||||
db : {},
|
||||
dburl : "https://ed.brz9.dev/proj/map/asset/json/db.json",
|
||||
db2 : {
|
||||
restaurants : {
|
||||
id : "resto",
|
||||
|
@ -119,6 +109,11 @@ let vm = new Vue({
|
|||
langElms[i].style.display = 'revert';
|
||||
}
|
||||
},
|
||||
async getName(){
|
||||
const res = await fetch(dburl);
|
||||
const data = await res.json();
|
||||
this.db = data;
|
||||
},
|
||||
setlang: function (lang) {
|
||||
target = document.querySelector("#"+"tab-"+lang);
|
||||
marker = document.querySelector("#lang-marker");
|
||||
|
|
Loading…
Reference in New Issue