karol-f / vue-custom-element

Vue Custom Element - Web Components' Custom Elements for Vue.js
https://karol-f.github.io/vue-custom-element/
MIT License
1.97k stars 187 forks source link

Issue with vue-class-component #201

Open vertic4l opened 4 years ago

vertic4l commented 4 years ago

Hi,

when using vue-class-component i got some overload issues, but why?

I already tried this workaround: (new Component()).$options but doesn't work either...

No overload matches this call. Overload 1 of 3, '(tag: string, componentDefinition: ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>, options?: options | undefined): void', gave the following error. Value of type 'typeof CookieConsent' has no properties in common with type 'ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>'. Did you mean to call it? Overload 2 of 3, '(tag: string, singleFileComponent: VueConstructor, options?: options | undefined): void', gave the following error. Argument of type 'typeof CookieConsent' is not assignable to parameter of type 'VueConstructor'. Type 'typeof CookieConsent' is missing the following properties from type 'VueConstructor': customElement, http Overload 3 of 3, '(tag: string, asyncComponentDefinition: () => Promise<ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>>, options?: options | undefined): void', gave the following error. Argument of type 'typeof CookieConsent' is not assignable to parameter of type '() => Promise<ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>>'. Type 'typeof CookieConsent' provides no match for the signature '(): Promise<ComponentOptions<Vue, DefaultData, DefaultMethods, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>>>'

karol-f commented 4 years ago

Can You prepare CodeSandbox?

Also maybe use Vue.customElement("test-component", Component.prototype.constructor.options);