M
M
Maxim2021-06-01 21:54:44
Vue.js
Maxim, 2021-06-01 21:54:44

How to display 404 in Vue?

There are routes

const routes = [
  {
    path: '/admin',
    component: () => import('../Pages/Dashboard.vue'),
    name: 'dashboard',
    children: [
      {
        path: 'requests',
        component: () => import('../Pages/Dashboard.vue'),
        name: 'requests'
      },
    ]
  },
  {
    path: '/admin/404',
    component: () => import('../Pages/Errors/NotFound.vue'),
    name: '404',
  }, 
  {
    path: '*',
    redirect: { name: '404' }
  }
]


if I follow these routes:

admin/blabla
admin/blabla/


then it gives out 404, and if it's

admin/blabla/blas it doesn't go to 404

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aetae, 2021-06-01
@Aetae

Everything is working:
I suspect something is wrong with your server rewrite settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question