修改代码首页跳转

master
lml 5 months ago
parent 3baf38ffea
commit f9f15129c1

@ -10,7 +10,7 @@
<div class="flx-align" style="width: 100%;">
<!-- LOGO -->
<div>
<a href="/home">
<a href="/newsHome">
<img style="width: 150px;" src="../../assets/images/home/logo_small.png" />
</a>
<!-- <button style="margin-top: 100px;" class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
@ -22,7 +22,7 @@
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav navbar-center" id="mySidenav">
<li class="nav-item">
<router-link class="nav-link" to="/home">首页</router-link>
<router-link class="nav-link" to="/newsHome">首页</router-link>
</li>
<li class="nav-item" >
<router-link class="nav-link" to="/business">业务介绍</router-link>
@ -68,7 +68,7 @@
<div class="flx-align" style="width: 100%;">
<!-- LOGO -->
<div>
<a href="/home">
<a href="/newsHome">
<img style="width: 150px;" src="../../assets/images/home/logo_small_black.png" />
</a>
<!-- <button class="navbar-toggler" type="button" data-toggle="collapse1" data-target="#navbarCollapse1"
@ -80,7 +80,7 @@
<div class="collapse1 navbar-collapse" id="navbarCollapse1">
<ul class="navbar-nav navbar-center" id="mySidenav1">
<li class="nav-item">
<router-link class="nav-link" to="/home">首页</router-link>
<router-link class="nav-link" to="/newsHome">首页</router-link>
</li>
<li class="nav-item" >
<router-link class="nav-link" to="/business">业务介绍</router-link>
@ -153,13 +153,11 @@
watch: {
'$route'(to, from) {
//
if(to.path ==='/home') {
if(to.path ==='/newsHome') {
this.color = 'white';
}else {
this.color = 'black';
}
//
}
}
};

@ -150,10 +150,10 @@ const routes = [
name: 'Forgot Password page',
component: Forgotpassword
},
// {
// path: '*', // 捕获所有不匹配的路径
// redirect: '/newsHome' // 重定向到/home
// }
{
path: '*', // 捕获所有不匹配的路径
redirect: '/newsHome' // 重定向到/home
}
];
const router = new VueRouter({

Loading…
Cancel
Save