aimeos and vuejs ( axios.get )
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
aimeos and vuejs ( axios.get )
Hello,
I use laravel and vuejs I want to display the product attributes using the following function:
and display the data in the component by the for ball like this:
but the last two lines ( {{product.attributes.product.id. }} ... ) are not correct.
Thank you
I use laravel and vuejs I want to display the product attributes using the following function:
Code: Select all
<script>
export default {
data () {
return {
products: {}
}
},
created () {
this.getProducts (); },
methods: {
getProducts () {
axios.get ('/ api / jsonapi / product')
.then (response => this.products = response.data)
.catch (err => console.log (err));
}
}
}
</script>
Code: Select all
<tr v-for = "(product, index) in products.data"
: key = "index">
<th scope = "row"> {{index}} </th>
<td> {{product.id}} </td>
<td> {{product.attributes.product.id. }}</td>
<td> </td>
<td> {{product ['attributes'] [product ['id']]}} </td>
</tr>
Thank you
Re: aimeos and vuejs ( axios.get )
Hello,
the secret line is :
It works very well !!! , but now I want to display pagination but I don't know how, there is no page variable to do like this:
this for offset:
Thank you
the secret line is :
Code: Select all
{{ product.attributes["product.url"]}}
Code: Select all
</div> <div class="card-footer d-flex justify-content-center">
<pagination :data="products" @pagination-change-page="getProducts"></pagination>
</div>
Code: Select all
axios.get('/api/jsonapi/product?page[offset]=0')
Re: aimeos and vuejs ( axios.get )
The links section of the response contains the first, prev, next and last links which you can use to build the pagination.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
