diff --git a/proj/map/asset/js/.main.js.swp b/proj/map/asset/js/.main.js.swp index af65efa..bc7d302 100644 Binary files a/proj/map/asset/js/.main.js.swp and b/proj/map/asset/js/.main.js.swp differ diff --git a/proj/map/asset/js/main.js b/proj/map/asset/js/main.js index a6551a1..687eb0d 100644 --- a/proj/map/asset/js/main.js +++ b/proj/map/asset/js/main.js @@ -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,7 +109,12 @@ let vm = new Vue({ langElms[i].style.display = 'revert'; } }, - setlang: function (lang) { + 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"); marker.style.left = target.offsetLeft + "px";