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

289
Visualizações
Vue : Uncaught TypeError: _ctx.toPage is not a function

when I clicked the button: it shows Uncaught TypeError: _ctx.toPage is not a function how can I fix this bug? please help me error pic

   <li v-for="pageLi of pageLis" :key="pageLi.id">
      <c-button @click="toPage(pageLi.path)">{{ pageLi.name }}</c-button>
    </li>


export default {
    setup() {
      const router = useRouter();
      const toPage = (path: string) => router.push(path);
      return {
        toPage,
      };
    },
  },
};
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The expected way to deal with Event Handling is to register an event handler with an inline handler or method handler (via the component methods property). See Event Handling for more details.

However, even in what you're trying to do in this example, you should notice that the DOM is not available until the mounted state in the Vue Lifecyle. See Lifecyle Hooks for more details.

Finally, from this code sample, it looks like you're trying to do either Dynamic Route Matching or Programmatic Navigation? If so, the Vue Router documentation is your friend.

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