markdown-it-vue
markdown-it-vue copied to clipboard
Typscript declarations breaks markdown-it-vue
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:
https://github.com/ravenq/markdown-it-vue/commit/986edce61a9d29e10cff9f3442a90e7ca518fce6
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 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