0👍
✅
Add a prop to Search-Category-Listing
export default {
name: 'Search-Category-Listing',
props: ['listing']
components: {
Sidebar
},
data() {
return {
searchlistingcategory: {
filter: []
},
urllisting: 'http://localhost:8000/upload/logo-default.png',
}
},
}
and send the data when pushing to the route.
this.$router.push({name: 'searchlistingcategory', params: {listing: response.data.listings } }})
You also need to change your route definition so params are pushed as props to the component
{
path: '/listings/search/filter',
name: 'searchlistingcategory',
component: SearchListingCategory,
props: true
},
Note that when using props: true
a route can only be navigated to using name
and not by using path
.
Source:stackexchange.com