平时BUG:vue
在vue中使用element ui 中的导航组件时,使用index做为跳转的路径,单击跳转没有问题,可是当刷新页面是,选项卡的激活
状态就变成初始化的了,起起初想到用获取window.location.search方法,效果是能够达到,可是后来发现这操做有的牵强,就换成了vue中
本身的获取路由路径的方式,以下:ui
1 let cur_path = this.$route.path; //获取当前路由 2 let routers = this.$router.options.routes; // 获取路由对象 3 this.activeIndex=cur_path.replace("/",""); 4 if(cur_path.indexOf("SystemSetup") > 0){ 5 this.activeIndex='SystemSetup' 6 }