Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

569
Visualizações
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......

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You can use path

const routeId = 3

this.$router.push({ path: `/actions-log/${routeId}` })
about 4 years ago · Juan Pablo Isaza Relatório

0

i figured out what's happening i have a component called pageTitle this component is included by every other component i use it to make the breadcrumb using the:

this.$route.fullPath

then spliting it and looping the values with :

<li><router-link></router-link></li>

to make the breadcrumbs links but the fullPath prop of the vue router it returns the params too so through the loop in:

<router-link :to="{ name: {path} }">{{ path }}</router-link>

vue checks if the router is exists with the given name, for example when i put /actions-log/3 as params int the url it will be set in the :to attribute becuase of this behavios it's launch that exception;

so i think i solved the problems in the following computed fuction : function to get the full path then split it and uses the values to create a breadCrumbs

the loop in the template

i don't know if someone has a better idea to create a breadCrumbs in vue... anyway thank you so much for helping me to resolve this problem.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda