const
nav = 'json/nav.json',
...
...
new Vue({
navlist: [],
timeline: [],
...
...
created() {
axios.get(nav).then((response) => {
this.navlist = response.data
}),
axios.get(counterts).then((response) => {
this.count = response.data
}),
axios.get(tline).then((response) => {
this.timeline = response.data
}),
...
...
...
...
},
created
? Получается громоздко... const fetchData = uri => axios.get(uri).then(({data}) => data);
function created() {
const nav = '';
const counterts = '';
const tline = '';
Promise.all([
fetchData(nav),
fetchData(counterts),
fetchData(tline),
]).then(([ navlist, count, timeline ]) => {
this.navlist = navlist;
this.count = count;
this.timeline = timeline;
}).catch(handleError)
}