[Vuejs]-Passing props to route component through this.$router.push in VueJS

0👍

The boolean mode only passes on route params, so avatar_url would have to be part of the url, something like:

{ path: '/chat/:avatar_url', component: MyChat, props: true},

In Vue 2, I remember you could still get other props from the route in function mode:

{
  path: '/chat',
  component: MyChat,
  props: route => ({ avatar_url: route.props.avatar_url })
},

but I am not sure if that still works in Vue 3.

Leave a comment