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

246
Visualizações
vue-router 4 '/:pathMatch(.*)*' not working?

hello guys I want to ask about vue-router. when I use vue 2 if there is a page that doesn't match, I use path: '*' to go to my page404 but in vue 3 it's been replaced with '/:pathMatch(.)' after i tried it the warning in console disappeared but i just got a blank page and it doesn't point to my page404. did i miss something? I'm newbie with vue 3

here is the version I'm using:

  1. vue: ^3.0.0
  2. vue-router: ^4.0.0-0

and this is my index.js

import { createRouter, createWebHistory, RouterView } from 'vue-router'

const routes = [
   {
      path: '/',
      redirect: '/login',
      component: RouterView,
      children: [{
        path: '/login',
        component: () => import('@/views/login/Login.vue'),
      }]
   },
   {
      path: '/:pathMatch(.*)*',
      component: () => import('@/views/page404/Page404.vue')
   }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})
about 4 years ago · Juan Pablo Isaza
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