You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser and version: Edge 111.0.1661.51 (Official build) (64-bit)
Description *
I think the TypeScript type declaration from the pageTrackerTemplate property is incorrect when compared against the documentation. I believe it is missing both the to and from parameters.
Please can you review the below and confirm whether this is intended?
Expected behavior
In the documentation for the page tracker template here, the pageTrackerTemplate in the code sample has the following signature.
The pageTrackerTemplate method will have both the to and the from route instances passed as parameters.
I'd expect the below to be a valid pageTrackerTemplate declaration when using TypeScript in Vue 3 and Vue Router v4 - the latter meaning that the arguments are of type RouteLocationNormalized.
where googleAnalyticsService.createPageView returns an interface that extends the vue-gtagPageView interface. (see other notes below).
Actual behavior
I receive the following TypeScript error.
Type '(to: RouteLocationNormalized) => PageView' is not assignable to type '() => PageView'.
Target signature provides too few arguments. Expected 1 or more, but got 0.ts(2322)
vue-gtag.d.ts(270, 5): The expected type comes from property 'pageTrackerTemplate' which is declared here on type 'PluginOptions'
Environment *
npm ls vue-gtag
:npm ls vue
:Windows
Edge 111.0.1661.51 (Official build) (64-bit)
Description *
I think the TypeScript type declaration from the
pageTrackerTemplate
property is incorrect when compared against the documentation. I believe it is missing both theto
andfrom
parameters.Please can you review the below and confirm whether this is intended?
Expected behavior
In the documentation for the page tracker template here, the
pageTrackerTemplate
in the code sample has the following signature.Additionally, there is the following note.
The pageTrackerTemplate method will have both the to and the from route instances passed as parameters.
I'd expect the below to be a valid
pageTrackerTemplate
declaration when using TypeScript in Vue 3 and Vue Router v4 - the latter meaning that the arguments are of typeRouteLocationNormalized
.where
googleAnalyticsService.createPageView
returns an interface that extends thevue-gtag
PageView
interface. (see other notes below).Actual behavior
I receive the following TypeScript error.
The type declaration is
It looks like it is missing both the
to
andfrom
parameters.Reproducible Demo in case of a bug report
I think my explanation above is sufficient for this issue. Let me know if you disagree.
Other Notes
We have extended the PageView interface in order to send additional values with page view events, and this worked on the previous version of
vue-gtag
.Thanks,
Cain
The text was updated successfully, but these errors were encountered: