提交 35bce35b authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 5f2df40d
......@@ -2,11 +2,11 @@
import TreeItem from './TreeItem.vue'
const navList = [
{ name: '首页', path: '/' },
{ name: '产品体系', path: '/#product' },
{ name: '首页', path: '/home' },
{ name: '产品体系', path: '/home#product' },
{ name: '精品课程', path: '/shop' },
{ name: '师资展示', path: '/#teacher' },
{ name: '预约报名', path: '/#contact' }
{ name: '师资展示', path: '/home#teacher' },
{ name: '预约报名', path: '/home#contact' }
]
</script>
......
......@@ -29,7 +29,7 @@ function toggleVisible(event: Event) {
<li class="tree-item" :class="{ 'is-active': isActive }">
<div class="cell" :class="{ bold: isFolder }" @click.capture="toggleVisible">
<div class="cell-title">
<a :href="item.path">{{ item.name }}</a>
<router-link :to="item.path">{{ item.name }}</router-link>
</div>
<div class="cell-icon" v-if="isFolder">
<i class="el-icon-arrow-up" v-if="isOpen"></i>
......
......@@ -3,7 +3,7 @@ import AppLayout from '@/components/layout/Index.vue'
export const routes: Array<RouteRecordRaw> = [
{
path: '/',
path: '/home',
component: AppLayout,
props: { fixed: true },
children: [{ path: '', component: () => import('./views/Index.vue') }]
......
......@@ -2,12 +2,15 @@ import { createRouter, createWebHistory } from 'vue-router'
// import { useUserStore } from '@/stores/user'
const router = createRouter({
scrollBehavior() {
scrollBehavior(to) {
if (to.hash) {
return { el: to.hash, top: 94 }
}
// 始终滚动到顶部
return { top: 0 }
},
history: createWebHistory(),
routes: [{ path: '/:pathMatch(.*)*', redirect: '/' }]
routes: [{ path: '/:pathMatch(.*)*', redirect: '/home' }]
})
// router.beforeEach((to, from, next) => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论