Static GitHub Issues

[94] Router Hooks define

prev: App (global) non-page-related component?
next: Browser Compatibility

Can i do something when router is instantiated; I wanne define a hook then like 'beforeEach';

Now I can do it in my component only.

created () {
    this.$router.afterEach((r) => {
      console.log('after each', r);
    })
}

That's not a good way. I wanne a hook or callback in framework options. just like require('my-custom-router-define.js')(router) after router is instantiated.

I see the plugins options are require in index.js

Can you require some function we define after the app instantiated, and call the function use param app

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c75">#c75</a>)</em></sub></div>