I've been attempting to load data from a local JSON file in Vue. My goal is to simply load the data from the file and assign it to a variable. I'm not sure if I'm on the right track or if I'm missing something essential in my approach. If you notice any mistakes in my question, please let me know.
Thank you in advance.
This is what my JavaScript file looks like:
import json from './ecommerce-products.json';
var vm=new Vue({
el:'#container',
data(){
return {
items:json
}
}
})