Init commit.
This commit is contained in:
43
src/router/index.ts
Normal file
43
src/router/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
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
|
||||
Reference in New Issue
Block a user