Hi there, Segment folks!
I think the developer experience could be greatly increased by having a user
pass in their Vue router's instance. That way you can create an afterEach router hook
so the user themselves wouldn't have to create a mounted() hook in each component.
A nice example is how vue-gtm solves this:
https://github.com/mib200/vue-gtm/blob/aacc3b521e3d17827d77aab8ca88cbb15162b583/src/index.js#L43
Would this be something you're willing to consider (and would you be open for a PR)?
Best,
andreas
Hi there, Segment folks!
I think the developer experience could be greatly increased by having a user
pass in their Vue router's instance. That way you can create an
afterEachrouter hookso the user themselves wouldn't have to create a
mounted()hook in each component.A nice example is how
vue-gtmsolves this:https://github.com/mib200/vue-gtm/blob/aacc3b521e3d17827d77aab8ca88cbb15162b583/src/index.js#L43
Would this be something you're willing to consider (and would you be open for a PR)?
Best,
andreas