I\'m building an app with laravel and VueJs and I was wondering how to pass a url parameter like the user slug or the user id to vuejs in a proper way to be able to use that pa
vue-router would probably be of help here. It lets you define your routes like so:
router.map({
'/user/:slug': {
component: Profile,
name: 'profile'
},
})
Within your Profile
component, the requested user's slug would then become available under this.$route.params.slug
Check the official documentation for details: http://router.vuejs.org/en/