[Vuejs]-Why won't my .vue file find the JSON I'm trying to pass it?

0👍

try to pass that json variable as props or define it before export default{ ...

in the main.js send that json to child component as follow :

     ...
     template: '<app :json="json"/>'
     ...

in the child component receive it like:

      export default {
       props:["json"],
        name: 'app',
         data () {
         return {
              test: this.json
       }
     }
    }

Leave a comment