'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......



Solution 1:[1]

You can use path

const routeId = 3

this.$router.push({ path: `/actions-log/${routeId}` })

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rotiken Gisa