Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while using params in the router.push function vue-router 4

hello guys i'm new to vue js and i'm trying to pass paramenters to a specific router this should happen when i click on a card research and then it will redirect to the research details component called actions-log but when i call this router via

this.$router.push({ name: "actions-log", params: { Id: "3" } })

it gives me an error in the console says:

Uncaught (in promise) Error: No match for {"name":"3","params":{}}

my function that redirects from the research to the research details

the actions-log router

my index.js routes configurations

the error in the browser console

so can any one help me with that error please......

like image 570
nerween Avatar asked Jun 06 '26 08:06

nerween


1 Answers

You can use path

const routeId = 3

this.$router.push({ path: `/actions-log/${routeId}` })
like image 105
Rotiken Gisa Avatar answered Jun 07 '26 22:06

Rotiken Gisa