cajames / vue-tag-manager

Simple Google Tag Manager implementation for Vue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

using `this.$gtm` does not compile properly

johnfumaster opened this issue · comments

It seems the $gtm is not declared properly and cannot be used in other components. When using this.$gtm, tslint throws the following error:

TS2339: Property '$gtm' does not exist on type

I see you've implemented it with Vue.prototype.$gtm. It doesn't seem to be the way to do it according to https://vuejs.org/v2/guide/typescript.html#Augmenting-Types-for-Use-with-Plugins