Skip to content
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

Typscript declarations breaks markdown-it-vue #40

Open
piscis opened this issue Dec 21, 2020 · 2 comments
Open

Typscript declarations breaks markdown-it-vue #40

piscis opened this issue Dec 21, 2020 · 2 comments

Comments

@piscis
Copy link

piscis commented Dec 21, 2020

Hi

I noticed that updating markdown-it-vue from 1.1.5 to 1.1.6 + using typescript. we get the following error:

  Overload 3 of 3, '(options: ComponentOptionsWithProps<{ content: { type: (StringConstructor | NumberConstructor)[]; default: string; }; options: { type: ObjectConstructor; default: () => {}; }; }, ... 4 more ..., { ...; } & {}>): VueProxy<...>', gave the following error.
    Type 'typeof MarkdownItVue' is not assignable to type 'VueConstructor<Vue> | FunctionalComponentOptions<any, PropsDefinition<any>> | ComponentOptions<never, any, any, any, any, Record<...>> | AsyncComponentPromise<...> | AsyncComponentFactory<...>'.
      Type 'typeof MarkdownItVue' is not assignable to type 'VueConstructor<Vue>'.

I think this has something todo with:

986edce

@piscis
Copy link
Author

piscis commented Dec 21, 2020

It helps to typecast it to a Vue constructor but it's only a temp. workaround.

....
import Vue, { VueConstructor } from 'vue';

export default defineComponent({
  name: 'MarkdownViewer',
  components: {
    Viewer: MarkdownViewer as VueConstructor<Vue>,
  },
 ...

@ggdream
Copy link

ggdream commented Apr 10, 2021

It helps to typecast it to a Vue constructor but it's only a temp. workaround.

....
import Vue, { VueConstructor } from 'vue';

export default defineComponent({
  name: 'MarkdownViewer',
  components: {
    Viewer: MarkdownViewer as VueConstructor<Vue>,
  },
 ...

It's works well, thank you evey much for the reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants