nuxt-community / legacy-modules

MIT License
1.28k stars 158 forks source link

fix(yandex-metrika): prepend router base to paths #386

Closed antmorozov closed 3 years ago

antmorozov commented 3 years ago

When Nuxt is hosted on the path other than /, yandex-metrika plugin sends wrong routes' paths with the hit method.

This PR fixes it by reading base option from router configuration and adding it to the beginning of the paths.

@IlyaSemenov, I see you've got some work in progress with this package, so please review it.

IlyaSemenov commented 3 years ago

Thanks. Yeah, that improve surely makes sense. It will be conflicting with my changes though so whichever is not merged first will need to be updated (not a big deal in either case).

I'd use const instead of let in your code. let is for variables that are supposed to be reassigned.

antmorozov commented 3 years ago

Thanks, @IlyaSemenov

I agree about const. The ready variable confused me somehow. Will fix it now.