我的情景
// mode: 'history'
{
path: '/',
component: Layout,
redirect: '/dashboard',
children: [{
path: 'dashboard',
name: 'Dashboard',
component: () => import('@/views/dashboard/index'),
meta: {
title: 'Dashboard', icon: 'dashboard' }
}]
},
重定向到/dashboard路径后刷新页面发现404,找不到这个页面,而我的路由模式是history。
解决
路由配置mode: 'history’改为默认mode: ‘hash’。