0๐
U can use fetch for that
var vm = new Vue({
....
methods: {
loadConfig(file) {
fetch('253.01.00.00.SD.json') //or fetch(file) if you want to fetch the given file
.then(function(response) {
return response.json();
})
.then(function(myJson) {
console.log(JSON.stringify(myJson));
});
}
}
....
- [Vuejs]-How to use onclick events when using Tabulator Ajax with VueJS?
- [Vuejs]-Slick.js don't work when v-for is updated
0๐
I assume that 253.01.00.00.SD.json
is some file on your local directory.
import json from './253.01.00.00.SD.json'
export default{
data(){
return{
ourData: json
}
}
}
In the template you do something like this:
<template>
<div>
<div v-for="data in ourData">{{data}}</div>
</div>
</template>
Source:stackexchange.com