I'm facing an issue with passing an array from one Vuejs
route to another. Specifically, I need to pass the array from home.vue
to post.vue
.
In my route.js
file for post.vue
, I have:
{
path: '/post/:cart',
name: 'post',
component: PostView,
props: true
}
This is how I've structured my home.vue
:
<router-link to="/post/:cart">Check out</router-link>
And in my post.vue
:
props: ['cart'],
mounted () {
console.log(this.$route.params.cart)
}
However, when I try to access the data stored in cart, it simply prints ":cart" in the console instead of the actual data. What am I doing wrong?