mirror of
https://gitee.com/log4j/pig-ui.git
synced 2025-01-03 23:42:23 +08:00
✨ Introducing new features. 修改首页内容放在菜单的第一行并且不由后端控制
This commit is contained in:
parent
616a7f8304
commit
a717222fd6
@ -25,6 +25,25 @@ const layouModules: any = import.meta.glob('../layout/routerView/*.{vue,tsx}');
|
|||||||
const viewsModules: any = import.meta.glob('../views/**/*.{vue,tsx}');
|
const viewsModules: any = import.meta.glob('../views/**/*.{vue,tsx}');
|
||||||
const dynamicViewsModules: Record<string, Function> = Object.assign({}, { ...layouModules }, { ...viewsModules });
|
const dynamicViewsModules: Record<string, Function> = Object.assign({}, { ...layouModules }, { ...viewsModules });
|
||||||
|
|
||||||
|
const home = [
|
||||||
|
{
|
||||||
|
path: '/home',
|
||||||
|
name: 'home',
|
||||||
|
component: () => import('/@/views/home/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: 'router.home',
|
||||||
|
isLink: '',
|
||||||
|
isHide: false,
|
||||||
|
isKeepAlive: true,
|
||||||
|
isAffix: true,
|
||||||
|
isIframe: false,
|
||||||
|
icon: 'iconfont icon-shouye',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 后端控制路由:初始化方法,防止刷新时路由丢失
|
* 后端控制路由:初始化方法,防止刷新时路由丢失
|
||||||
* @method NextLoading 界面 loading 动画开始执行
|
* @method NextLoading 界面 loading 动画开始执行
|
||||||
@ -48,7 +67,7 @@ export async function initBackEndControlRoutes() {
|
|||||||
// 存储接口原始路由(未处理component),根据需求选择使用
|
// 存储接口原始路由(未处理component),根据需求选择使用
|
||||||
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
||||||
// 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由
|
// 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由
|
||||||
dynamicRoutes[0].children = [...await backEndComponent(res.data), ...staticConfigRoutes]
|
dynamicRoutes[0].children = [...home,...await backEndComponent(res.data), ...staticConfigRoutes]
|
||||||
// 添加动态路由
|
// 添加动态路由
|
||||||
await setAddRoute();
|
await setAddRoute();
|
||||||
// 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
|
// 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
|
||||||
|
@ -42,12 +42,27 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
|||||||
path: '/',
|
path: '/',
|
||||||
name: '/',
|
name: '/',
|
||||||
component: () => import('/@/layout/index.vue'),
|
component: () => import('/@/layout/index.vue'),
|
||||||
redirect: '/home/index',
|
redirect: '/home',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'hzxc',
|
title: 'hzxc',
|
||||||
isKeepAlive: true,
|
isKeepAlive: true,
|
||||||
},
|
},
|
||||||
children: [],
|
children: [
|
||||||
|
{
|
||||||
|
path: '/home',
|
||||||
|
name: 'home',
|
||||||
|
component: () => import('/@/views/home/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: 'router.home',
|
||||||
|
isLink: '',
|
||||||
|
isHide: false,
|
||||||
|
isKeepAlive: true,
|
||||||
|
isAffix: true,
|
||||||
|
isIframe: false,
|
||||||
|
icon: 'iconfont icon-shouye',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user