赞
踩
this.$router:获取全局路由
this.$route:获取当前路由信息
- computed: {
- // 获取当前路由的子路由
- routes(){
- var routes = {
- children: this.$router.options.routes
- };
-
- var route = this.$route.matched;
-
- for(var i=0; i<route.length-1; i++){
- routes = routes.children.find((e) => (e.name == route[i].name));
- }
-
- return routes.children
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。