fiee-official-website/src/router/index.js

84 lines
2.0 KiB
JavaScript
Raw Normal View History

2025-05-22 06:56:37 +00:00
// router/index.js
2025-05-23 01:04:20 +00:00
import { createRouter, createWebHistory } from "vue-router";
import { setupRouterGuards } from "./router-guards";
2025-05-22 06:56:37 +00:00
const routes = [
2025-05-23 01:04:20 +00:00
{
path: "/",
redirect: "home",
},
{
path: "/home",
name: "home",
component: () => import("@/views/home/index.vue"),
// beforeEnter: (to, from, next) => {
2025-05-22 06:56:37 +00:00
2025-05-23 01:04:20 +00:00
// localStorage.clear()
// next()
// }
},
{
path: "/contacts",
name: "contacts",
component: () => import("@/views/contacts/index.vue"),
},
{
path: "/companyoverview",
name: "companyoverview",
component: () => import("@/views/companyoverview/index.vue"),
},
{
path: "/myhome",
name: "myHome",
component: () => import("@/views/myHome/index.vue"),
},
{
path: "/businessservices",
name: "BusinessServices",
component: () => import("@/views/BusinessServices/index.vue"),
},
{
path: "/manage",
name: "manage",
component: () => import("@/views/manage/index.vue"),
},
// {
// 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'),
// },
2025-05-22 06:56:37 +00:00
];
const router = createRouter({
2025-05-23 01:04:20 +00:00
history: createWebHistory(),
routes,
2025-05-22 06:56:37 +00:00
});
router.beforeEach((to, from, next) => {
2025-05-23 01:04:20 +00:00
if (to.meta?.title) {
document.title = to.meta.title;
}
next();
2025-05-22 06:56:37 +00:00
});
setupRouterGuards(router);
export default router;