Configuration of router :
const routes = [
{ path: '/' , redirect: '/login'},
{ path: '/chat', component: MyChat,props: true},
{ path: '/login', component: MyLogin},
]
Chat component with props :
export default {
name: "MyChat",
props:{
avatar_url : {
type: String,
}
}
The router push to pass props :
this.$router.push({path:'/chat',props: {avatar_url: 'rrrrrrr'}});
When I’m passing props directly in routes array it does work :
const routes = [
{ path: '/' , redirect: '/login'},
{ path: '/chat', component: MyChat,props: {avatar_url: 'myurl'}},
{ path: '/login', component: MyLogin},
]
But when I try to pass props in the this.$router.push it doesn’t , if anyone has an answer to that.