- make props: true for the destination route — in the index.js file of router
{
path: '/home',
name: 'home',
component: taskChooser,
props: true,
}
-
define prop in the component e.g props: [‘myprop’], – note the quotes
-
copy the variable you want to pass from the source route into the same name as your prop – in this case myprop
myprop = theVariableThatYouWantToPass
this.$router.replace({name:'home', params:{myprop}});
Make sure that the name of prop and variable are same – the prop is in quotes.
It’s working for me.