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 } }
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/233704.html原文链接:https://javaforall.net