| | |
| | | </el-menu-item> |
| | | <el-menu-item index="/">首页</el-menu-item> |
| | | <el-menu-item index="/product">产品中心</el-menu-item> |
| | | <el-menu-item index="/contact">联系我们</el-menu-item> |
| | | <!-- <el-menu-item index="/contact">联系我们</el-menu-item> --> |
| | | <el-menu-item index="/about">关于我们</el-menu-item> |
| | | </el-menu> |
| | | </div> |
| | |
| | | // console.log('选中菜单:', index); |
| | | if(index === '/logo'){ |
| | | router.push('/'); |
| | | }else{ |
| | | }else if(index === '/about'){ |
| | | router.push({path:'/',hash:'#third-other'}); |
| | | } |
| | | else{ |
| | | router.push(index); |
| | | } |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="third-other"> |
| | | <div id="third-other" class="third-other"> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <div class="third-other-title">产品中心</div> |
| | |
| | | |
| | | const router = createRouter({ |
| | | history: createWebHistory(), |
| | | routes |
| | | routes, |
| | | scrollBehavior(to, from, savedPosition) { |
| | | if (to.hash) { |
| | | return { |
| | | el: to.hash, |
| | | behavior: 'smooth' |
| | | }; |
| | | } |
| | | return savedPosition || { top: 0 }; |
| | | } |
| | | }); |
| | | |
| | | export default router; |