Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

297
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda