index.js
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const routes = [
{
path: '/',
name: 'home',
component: () => myImport('views/home/index')
},
{
path: '/services',
name: 'services',
component: () => myImport('views/services/index')
},
{
path: '/about',
name: 'about',
component: () => myImport('views/about/index')
},
{
path: '/concat',
name: 'concat',
component: () => myImport('views/concat/index')
},
//信息化协同管理支撑平台
{
path: '/services/information',
name: 'information',
component: () => myImport('views/serviceSecond/information/index')
},
//安全日志分析管理系统
{
path: '/services/securityLog',
name: 'securityLog',
component: () => myImport('views/serviceSecond/securityLog/index')
},
//业务及应用综合分析平台
{
path: '/services/businessApp',
name: 'businessApp',
component: () => myImport('views/serviceSecond/businessApp/index')
},
];
const router = VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
routes
});
router.beforeEach(async (to, from, next) => {
$('[top-nav]').removeClass('current');
$('[top-nav="'+to.name+'"]').addClass('current');
// 回到顶部
$('html, body').animate({
scrollTop: 0
}, 500);
next();
})
export default router