页面刷新后,路由没有跳到相对应的导航栏
1. 我们可以通过获取当前$route.path,和导航栏的router进行匹配【当前使用了 lodash 的 map 遍历导航栏列表【this.navList】】
_.map(this.navList, (item, index) => { if (this.$route.path.replace(///g, '') === item.router) { this.currentIndex = index } })