-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not usable in Vue 3 with Typescript? #89
Comments
I've been having the same problem myself, and it looks like the I've patched vue-gtm locally and it appears to build and run OK, but I'm not sure what scenarios would need to be tested for this. |
Need to look into this later edit: nevermind ^^ overlooked #96 |
I looked into the code and I'm thinking that it's not correct that Line 85 in 828d437
Also tested it with And changed the import { createApp } from "vue";
import App from "./App.vue";
import VueGtm from "vue-gtm";
const app = createApp(App);
app.use(VueGtm, {
id: "GTM-xxxxxxx",
});
app.mount("#app"); In |
Ah now I understand! So maybe we need to relax the own definitions, or we need to wait until Vue3 is released |
Wow ... didn't expect Vue 3 to be released after a few days ... My HIGHEST priority today will be to move typedefs to Vue 3 compatibility and then open a parallel branch+release |
I have released an alpha: https://www.npmjs.com/package/vue-gtm/v/3.0.0-alpha.1 Currently there is one problem... When using Also I'm not sure what's the replacement for |
Fixed a thing with https://www.npmjs.com/package/vue-gtm/v/3.0.0-alpha.3 But in this moment there could be a problem with import { /*NavigationGuard,*/ RouteLocationNormalizedLoaded, Router } from "vue-router";
declare module "@vue/runtime-core" {
/*export interface ComponentCustomOptions {
beforeRouteEnter?: NavigationGuardWithThis<undefined>;
beforeRouteUpdate?: NavigationGuard;
beforeRouteLeave?: NavigationGuard;
}*/
export interface ComponentCustomProperties {
$route: RouteLocationNormalizedLoaded;
$router: Router;
}
} Edit: forget the workaround... This will break Vue completely... I will open a new issue in |
@rrrodzilla @craignicol In import { createGtm } from 'vue-gtm';
app.use(createGtm({
id: ...
})); |
Cause I released 3.0.0 for vue 3, I will close this issue now |
Am I correct that this isn't working in Vue 3 with a typescript main.ts? The imported VueGtm type isn't assignable to the first param of the use function since that's expecting something that implements the install method of Plugin_2. Or am I just doing this wrong? Anybody been able to make this work?
Thanks,
Roland
The text was updated successfully, but these errors were encountered: