Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
vue-router 4 redirige la URL predeterminada a la página no encontrada

Estoy migrando mi aplicación vue vue 2 a vue 3 siguiendo la documentación oficial de migración de vue. He actualizado el paquete vue-router. Después de actualizar router.js, si estoy ejecutando la aplicación en mi local de forma predeterminada, está enrutando a la página 404 componente no encontrado.

Anteriormente, estaba enrutando a la página de descripción general (http://localhost:8080/overview). Ahora esta URL está enrutando a la página no encontrada. Aquí está mi enrutador.js

enrutador.js

 /* [IMPORT] Library */ import { createRouter, createWebHistory } from 'vue-router'; /* [IMPORT] Common module */ import store from '~/common/store'; /* [IMPORT] modules */ import devModule from '~/module/devModule'; import pageNotFoundPage from '~/page/common/pageNotFound'; /* [IMPORT][PAGE] OverView */ import overviewPage from '~/page/overview/overviewPage'; const routes = [ { path: '/' , redirect: '/dev'}, { path: '/dev', component: devModule, children: [ /* Default routing*/ { path: '', redirect: 'overview/overview'}, /* OVERVIEW */ { path: 'overview', redirect: 'overview/overview'}, { path: 'overview/overview' , component: overviewPage} ]}, /* [404] anything else... */ { path: '/:catchAll(.*)' , component: pageNotFoundPage }, ]; export const router = createRouter({ history: createWebHistory(), routes }); /* [intercepter] */ router.beforeEach(function(to, from, next) { // 1. Update current URL :: for store store.commit('moveMenu',to.path); // x. go to next menu next(); }); export default router;

¿Por qué no se enruta a la página de descripción general después de la migración? Cualquier sugerencia o guía será útil relacionada con esto.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe concatenar la ruta de la ruta secundaria con la principal como:

 http://localhost:8080/dev/overview

para obtener más detalles, consulte la sección de rutas anidadas en los documentos oficiales

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!