update router/index.js
This commit is contained in:
parent
62cdedb9df
commit
3cdcf5303f
@ -23,7 +23,7 @@ import Layout from '@/layout'
|
|||||||
|
|
||||||
// 公共路由
|
// 公共路由
|
||||||
export const constantRoutes = [
|
export const constantRoutes = [
|
||||||
{
|
{
|
||||||
path: '/redirect',
|
path: '/redirect',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
@ -32,28 +32,28 @@ export const constantRoutes = [
|
|||||||
path: '/redirect/:path(.*)',
|
path: '/redirect/:path(.*)',
|
||||||
component: () => import('@/views/redirect/index.vue')
|
component: () => import('@/views/redirect/index.vue')
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
component: () => import('@/views/login'),
|
component: () => import('@/views/login'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// path: '/register',
|
// path: '/register',
|
||||||
// component: () => import('@/views/register'),
|
// component: () => import('@/views/register'),
|
||||||
// hidden: true
|
// hidden: true
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
path: "/:pathMatch(.*)*",
|
path: "/:pathMatch(.*)*",
|
||||||
component: () => import('@/views/error/404'),
|
component: () => import('@/views/error/404'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/401',
|
path: '/401',
|
||||||
component: () => import('@/views/error/401'),
|
component: () => import('@/views/error/401'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/index',
|
redirect: '/index',
|
||||||
@ -64,8 +64,8 @@ export const constantRoutes = [
|
|||||||
name: 'Index',
|
name: 'Index',
|
||||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
@ -77,10 +77,26 @@ export const constantRoutes = [
|
|||||||
name: 'Profile',
|
name: 'Profile',
|
||||||
meta: { title: '个人中心', icon: 'user' }
|
meta: { title: '个人中心', icon: 'user' }
|
||||||
}]
|
}]
|
||||||
}];
|
},
|
||||||
|
// 不用可删掉
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: Layout,
|
||||||
|
hidden: false,
|
||||||
|
meta: { title: '组件示例', icon: 'icon', noCache: 'fasle' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'icon',
|
||||||
|
component: () => import('@/views/components/icons/index'),
|
||||||
|
name: 'icon',
|
||||||
|
meta: { title: '图标icon', icon: 'icon1', noCache: 'fasle' }
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.VITE_APP_ROUTER_PREFIX),
|
history: createWebHistory(
|
||||||
|
import.meta.env.VITE_APP_ROUTER_PREFIX),
|
||||||
routes: constantRoutes,
|
routes: constantRoutes,
|
||||||
// scrollBehavior(to, from, savedPosition) {
|
// scrollBehavior(to, from, savedPosition) {
|
||||||
// if (savedPosition) {
|
// if (savedPosition) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user