Skip to content

Integrating with vue-router #10

Closed
Closed
@andreasvirkus

Description

@andreasvirkus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions