|
|
@@ -9,7 +9,7 @@
|
|
|
期刊微信公众号管理系统
|
|
|
</div>
|
|
|
<div class="nav">
|
|
|
- <router-link class="active" to="/">首页</router-link>
|
|
|
+ <router-link class="active" to="/index/index">首页</router-link>
|
|
|
<router-link to="">期刊管理</router-link>
|
|
|
<router-link to="">刊群导览</router-link>
|
|
|
<router-link to="">学术交流</router-link>
|
|
|
@@ -77,6 +77,18 @@
|
|
|
import Router from 'vue-router'
|
|
|
export default {
|
|
|
name: 'home',
|
|
|
+ watch:{
|
|
|
+ $route(to,from){
|
|
|
+ let mod = to.path.split("/")[1];
|
|
|
+ this.$router.options.routes.forEach((element,i) => {
|
|
|
+ if(element.path.indexOf(mod)==-1){
|
|
|
+ element.show = 0
|
|
|
+ }else{
|
|
|
+ element.show = 1
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
checkedCompany:'',
|
|
|
@@ -115,34 +127,10 @@ export default {
|
|
|
},
|
|
|
getData(){
|
|
|
|
|
|
- },
|
|
|
- toPath(e){
|
|
|
- let mod = e.target.hash.split("/")[1];
|
|
|
- this.$router.options.routes.forEach((element,i) => {
|
|
|
- if(element.path.indexOf(mod)==-1){
|
|
|
- this.$router.options.routes[i].show = 1
|
|
|
- // element.show = 0
|
|
|
- }else{
|
|
|
- this.$router.options.routes[i].show = 0
|
|
|
- // element.show = 1
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
- let mod = this.$route.path.split("/")[1];
|
|
|
- this.$router.options.routes.forEach((element,i) => {
|
|
|
- console.log(element.path,333333333333)
|
|
|
- console.log(element.path.indexOf(mod))
|
|
|
- if(element.path.indexOf(mod)==-1){
|
|
|
- // this.$router.options.routes[i].show = 0
|
|
|
- element.show = 0
|
|
|
- }else{
|
|
|
- // this.$router.options.routes[i].show = 1
|
|
|
- element.show = 1
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
</script>
|