首页 > 其他分享 >2022.12.17 - vue Router4 关于嵌套路由配置无匹配页面导致失效问题

2022.12.17 - vue Router4 关于嵌套路由配置无匹配页面导致失效问题

时间:2022-12-17 11:56:49浏览次数:41  
标签:vue 17 .. verify component Router4 import path webpackChunkName

const routes = [
	{
		path: '',
		name: 'home',
		component: () => import(/* webpackChunkName: "home" */ '../pages/index'),
		children: [
			{
				path: '',
				name: 'welcome',
				component: () => import(/* webpackChunkName: "welcome" */ '../views/content/welcome')
			},
			{
				path: 'evaluator',
				name: 'evaluator',
				component: () => import(/* webpackChunkName: "evaluator" */ '../views/content/evaluator')
			},
		]
	},
	{
		path: '/verify',
		name: 'verify',
		component: () => import(/* webpackChunkName: "verify" */ '../pages/verify')
	},
	{
		// 无匹配应该重定向到主页,而不需要跳到指定页面,也不需要给特定的名字做标识
		path: '/:chapters*',
		redirect: { path: ' ' }
	}
];

标签:vue,17,..,verify,component,Router4,import,path,webpackChunkName
From: https://www.cnblogs.com/yehuda/p/16988793.html

相关文章