[Vuejs]-Access the third party child component from parent component vue

0👍

You can perform a request with Axios or other tools to the server.
in created() hook of the component.

I used Axios for this example

<example-component route="{{ route('admin.upload.media', $folder) }}">
...
</example-component>

and in your component .vue file, you can add

export default {
  props: {
    route: String
  },
  data() {
    return {
      variable: null
    };
  },
  created() {
    this.axios(this.route).then(res => { this.variable = res.data });
  }
  ...
};

Leave a comment