监测路由变化,高亮顶部导航
Showing
1 changed file
with
7 additions
and
1 deletions
| ... | @@ -164,7 +164,13 @@ export default { | ... | @@ -164,7 +164,13 @@ export default { | 
| 164 | }, | 164 | }, | 
| 165 | watch: { | 165 | watch: { | 
| 166 | "$route.path": function(newPath) { | 166 | "$route.path": function(newPath) { | 
| 167 | this.defaultActive = this.pathAndCodeObj[newPath]; | 167 | //监测路由变化,高亮顶部导航 | 
| 168 | this.headTop.forEach((item, index) => { | ||
| 169 | item.select = false; | ||
| 170 | if (item.path == newPath) { | ||
| 171 | item.select = true; | ||
| 172 | } | ||
| 173 | }); | ||
| 168 | }, | 174 | }, | 
| 169 | }, | 175 | }, | 
| 170 | created() { | 176 | created() { | ... | ... | 
- 
Please register or sign in to post a comment