JanGuillermo/vue3-markdown-it

Typescript Support

little3201 opened this issue ยท 6 comments

has typescript support plan ?

Hi @little3201!

This has been planned, although I haven't gotten to it. I'll get back to you later in this thread.

@JanGuillermo

I guess it is the same problem.

vue 3 + typescript

ERROR in src/components/modules/Markdown.vue:7:27
TS7016: Could not find a declaration file for module 'vue3-markdown-it'. '/Users/wc/codebase/my-project/QuantiInvestSystem/frontend/node_modules/vue3-markdown-it/dist/vue3-markdown-it.umd.min.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/vue3-markdown-it` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue3-markdown-it';`
     5 | <script lang="ts">
     6 | import { defineComponent } from "vue";
  >  7 | import VueMarkdownIt from "vue3-markdown-it";
       |                           ^^^^^^^^^^^^^^^^^^
     8 |
     9 | export default defineComponent({
    10 |   name: "markdown",


Yes, i've the same issue... ๐Ÿ˜ž

Yes, i've the same issue... ๐Ÿ˜ž

if not exist, create a shims-vue.d.ts file (next to package.json) and write in that file: declare module 'vue3-markdown-it';

Typescript support should be pretty easy to add, just rename the files to .ts, use defineComponent and use PropType.

Yes, i've the same issue... disappointed

if not exist, create a shims-vue.d.ts file (next to package.json) and write in that file: declare module 'vue3-markdown-it';

better in the src folder