QYF-GitLab1
2 天以前 b13c22021fca126ecf0a4fc1ac315cfecd668ed8
src/router/index.js
@@ -1,5 +1,8 @@
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import HomeView from '../views/home/index.vue'
import aboutUs from '../views/aboutUs/index.vue'
import bookStore from '../views/bookStore/index.vue'
import bookdetail from '../views/bookStore/detail.vue'
import PageLayout from '../layout/baseLayout.vue'
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
@@ -14,6 +17,43 @@
          path: '/home',
          name: 'home',
          component: HomeView,
        },
        {
          path: '/aboutUs',
          name: 'aboutUs',
          component: aboutUs,
        },
        {
          path: '/bookdetail',
          name: 'bookdetail',
          component: bookdetail,
          meta: {
            scrollToTop: true,
          },
        },
        {
          path: '/search',
          name: 'search',
          meta: {
            name: '搜索',
          },
          component: () => import('@/views/home/search.vue'),
        },
        {
          path: '/bookStore',
          name: 'bookStore',
          component: bookStore,
          meta: {
            scrollToTop: true,
          },
        },
        {
          path: '/textBookApply',
          name: 'textBookApply',
          component: () => import('@/views/bookStore/textBookApply.vue'),
          meta: {
            scrollToTop: true,
          },
        },
        //个人中心
        {
@@ -242,6 +282,9 @@
      ],
    },
  ],
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 }
  },
})
export default router