44 lines
1023 B
TypeScript
44 lines
1023 B
TypeScript
import { createRouter, createWebHistory } from 'vue-router'
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
name: 'home',
|
|
component: () => import('../views/HomeView.vue'),
|
|
},
|
|
{
|
|
path: '/about',
|
|
name: 'about',
|
|
component: () => import('../views/AboutView.vue'),
|
|
},
|
|
{
|
|
path: '/waterlife',
|
|
name: 'waterlife',
|
|
component: () => import('../views/WaterLifeProducts.vue'),
|
|
},
|
|
{
|
|
path: '/agedlife',
|
|
name: 'agedlife',
|
|
component: () => import('../views/AgedLifeProducts.vue'),
|
|
},
|
|
{
|
|
path: '/media',
|
|
name: 'media',
|
|
component: () => import('../views/MediaView.vue'),
|
|
},
|
|
{
|
|
path: '/greenproducts',
|
|
name: 'media',
|
|
component: () => import('../views/MediaView.vue'),
|
|
},
|
|
],
|
|
scrollBehavior(to, from, savedPosition) {
|
|
// 始终滚动到页面顶部
|
|
return { top: 0, behavior: 'smooth' }
|
|
},
|
|
})
|
|
|
|
export default router
|