使用 this.$router.options.routes

this.$router 返回的事VueRouter这个对象

VueRouter {app: Vue, apps: Array(1), options: {…}, beforeHooks: Array(1), resolveHooks: Array(0), …}

afterHooks: [ƒ]

app: Vue {_uid: 2, _isVue: true, $options: {…}, _renderProxy: Proxy, _self: Vue, …}

apps: [Vue]

beforeHooks: [ƒ]

fallback: false

history: HashHistory {router: VueRouter, base: "", current: {…}, pending: null, ready: true, …}

matcher: {match: ƒ, addRoutes: ƒ}

mode: "hash"

options: {scrollBehavior: ƒ, routes: Array(13)}

resolveHooks: []

currentRoute: (...)
__proto__: Object

 

 

Logo

前往低代码交流专区

更多推荐