Skip to content

Commit

Permalink
Update $gtm global property augmentation (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
romansp authored Aug 14, 2024
1 parent 5268e63 commit 7dbf04f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"vue-router": "^4.2.5"
},
"peerDependencies": {
"vue": ">= 3.2.0 < 4.0.0"
"vue": ">= 3.2.26 < 4.0.0"
},
"peerDependenciesMeta": {
"vue-router": {
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ export function createGtm(options: VueGtmUseOptions): VueGtmPlugin {
return { install: (app: App) => install(app, options) };
}

// @ts-expect-error: assume that `vue` already brings this dependency
declare module '@vue/runtime-core' {
declare module 'vue' {
// eslint-disable-next-line jsdoc/require-jsdoc
export interface ComponentCustomProperties {
/**
Expand Down Expand Up @@ -240,7 +239,6 @@ export default _default;
* @returns The Vue GTM instance if the it was installed, otherwise `undefined`.
*/
export function useGtm(): GtmPlugin | undefined {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return (
getCurrentInstance()?.appContext?.app?.config?.globalProperties?.$gtm ??
gtmPlugin
Expand Down

0 comments on commit 7dbf04f

Please sign in to comment.