officialWebsite/src/router/index.js
2025-02-19 19:04:19 +08:00

41 lines
930 B
JavaScript

// router/index.js
import { createRouter, createWebHistory } from 'vue-router';
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: '/businessintroduction',
name: 'Businessintroduction',
component: () => import('@/views/businessintroduction/index.vue'),
},
];
const router = createRouter({
history: createWebHistory(),
routes
});
router.beforeEach((to, from, next) => {
if (to.meta?.title) {
document.title = to.meta.title;
}
next()
});
export default router;