59 lines
1.4 KiB
JavaScript
59 lines
1.4 KiB
JavaScript
|
// router/index.js
|
||
|
import { createRouter, createWebHistory } from 'vue-router';
|
||
|
import { setupRouterGuards } from './router-guards';
|
||
|
|
||
|
const routes = [
|
||
|
{
|
||
|
path: '/',
|
||
|
redirect: 'home'
|
||
|
},
|
||
|
{
|
||
|
path: '/home',
|
||
|
name: 'home',
|
||
|
component: () => import('@/views/home/index.vue'),
|
||
|
// beforeEnter: (to, from, next) => {
|
||
|
|
||
|
// localStorage.clear()
|
||
|
// next()
|
||
|
// }
|
||
|
},
|
||
|
{
|
||
|
path: '/companyprofil',
|
||
|
name: 'Companyprofil',
|
||
|
component: () => import('@/views/companyprofil/index.vue'),
|
||
|
},
|
||
|
{
|
||
|
path: '/companyprofildetail',
|
||
|
name: 'Companyprofildetail',
|
||
|
component: () => import('@/views/companyprofildetail/index.vue'),
|
||
|
},
|
||
|
{
|
||
|
path: '/businessintroduction',
|
||
|
name: 'Businessintroduction',
|
||
|
component: () => import('@/views/businessintroduction/index.vue'),
|
||
|
},
|
||
|
{
|
||
|
path: '/investor',
|
||
|
name: 'Investor',
|
||
|
component: () => import('@/views/investor/index.vue'),
|
||
|
},
|
||
|
{
|
||
|
path: '/investorhandbook',
|
||
|
name: 'Investorhandbook',
|
||
|
component: () => import('@/views/investorhandbook/index.vue'),
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const router = createRouter({
|
||
|
history: createWebHistory(),
|
||
|
routes
|
||
|
});
|
||
|
router.beforeEach((to, from, next) => {
|
||
|
if (to.meta?.title) {
|
||
|
document.title = to.meta.title;
|
||
|
}
|
||
|
next()
|
||
|
});
|
||
|
setupRouterGuards(router);
|
||
|
export default router;
|