mardi 23 juin 2020

How to list multiple objects from laravel to vue using javascript filter function?

I am passing multiple objects from laravel to vue and want to populate my vue objects with values given from the database.

The data from laravel:

enter image description here

Vue objects:

  storeName: {},
  storeUrl: {},
  appName: {},
  price: {},
  share: {},

Where the data comes:

  mounted() {
  axios.get('/dashboard/affiliates')
    .then(res => {
      let data = res.data;

      this.storeName = data.affiliates.shop_name;
      console.log(data.affiliates);
    })

As I understand, one of the bests ways would be to populate my vue objects it would be with filter function of javascript, but quite don't get it fully and don't know how to do it.

How could I populate vue objects with data that later on I could list them to the view in a v-for?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire