hookehuyr

history模式调整

<!--
* @Date: 2024-09-26 13:42:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-12 15:01:03
* @LastEditTime: 2024-12-12 15:28:53
* @FilePath: /hager/src/components/common/hagerHeader.vue
* @Description: 文件描述
-->
......@@ -64,12 +64,12 @@
<div :class="[is_active === 'about' ? 'active' : '', 'item']" @click="goTo('/about')">关于海格</div>
<div :class="[is_active === 'contact' ? 'active' : '', 'item']" @click="goTo('/contact')">联系我们</div>
<div :class="[is_active === 'index' ? 'active' : '', 'item']" @click="goTo('/')">首页</div> -->
<a :class="[is_active === 'solution' ? 'active' : '', 'item']" :href="`${baseUrl}#/solution/index`" @click="goTo('/solution/index')">解决方案</a>
<a :class="[is_active === 'news' ? 'active' : '', 'item']" :href="`${baseUrl}#/news`" @click="goTo('/news')">新闻中心</a>
<a :class="[is_active === 'recruit' ? 'active' : '', 'item']" :href="`${baseUrl}#/recruit`" @click="goTo('/recruit')">招聘信息</a>
<a :class="[is_active === 'about' ? 'active' : '', 'item']" :href="`${baseUrl}#/about`" @click="goTo('/about')">关于海格</a>
<a :class="[is_active === 'contact' ? 'active' : '', 'item']" :href="`${baseUrl}#/contact`" @click="goTo('/contact')">联系我们</a>
<a :class="[is_active === 'index' ? 'active' : '', 'item']" :href="`${baseUrl}#/`" @click="goTo('/')">首页</a>
<a :class="[is_active === 'solution' ? 'active' : '', 'item']" :href="`${baseUrl}/solution/index`" @click.prevent="goTo('/solution/index')">解决方案</a>
<a :class="[is_active === 'news' ? 'active' : '', 'item']" :href="`${baseUrl}/news`" @click.prevent="goTo('/news')">新闻中心</a>
<a :class="[is_active === 'recruit' ? 'active' : '', 'item']" :href="`${baseUrl}/recruit`" @click.prevent="goTo('/recruit')">招聘信息</a>
<a :class="[is_active === 'about' ? 'active' : '', 'item']" :href="`${baseUrl}/about`" @click.prevent="goTo('/about')">关于海格</a>
<a :class="[is_active === 'contact' ? 'active' : '', 'item']" :href="`${baseUrl}/contact`" @click.prevent="goTo('/contact')">联系我们</a>
<a :class="[is_active === 'index' ? 'active' : '', 'item']" :href="`${baseUrl}/`" @click.prevent="goTo('/')">首页</a>
</div>
</el-col>
</el-row>
......@@ -210,7 +210,7 @@ export default {
},
computed: {
baseUrl () {
return location.origin + location.pathname;
return location.origin;
}
},
async mounted () {
......
......@@ -12,8 +12,9 @@ import ConfigRouter from './route.js'
Vue.use(VueRouter)
const router = new VueRouter({
history: false,
hashbang: true,
// history: false,
// hashbang: true,
mode: 'history',
base: '/',
routes: ConfigRouter,
scrollBehavior(to, from, savedPosition) {
......