Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VUE error : Discarded invalid param(s) "recordIds", "datasources" when navigating

in Vue i am facing an issue while passing params from one route to another. This with what my target route looks like :

{
   path: '/record-modification',
   name: 'recordModification',
   component: recordModification,
   meta: { needAuthentication: true, needCaseId: true }
}

This is how i am pushing data to route :

this.$router.push({
     name: 'recordModification',
     params: {
         recordIds,
         datasources
     }
});

But on target page when i tried to access this.$route.params i am getting an empty object. Any idea what wrong am i doing here ?

like image 248
Maverick Avatar asked Sep 13 '25 21:09

Maverick


1 Answers

change params to query:

this.$router.push({
     name: 'recordModification',
     query: {
         recordIds,
         datasources
     }
});
and change it when you call the params in 'recordModification' too:
 $route.query.recordIds
like image 120
Chaimae GRICH Avatar answered Sep 16 '25 10:09

Chaimae GRICH