raiblaze / vue3-html2pdf

71 stars 18 forks source link

Missing typescript support #15

Open MartinX3 opened 1 year ago

MartinX3 commented 1 year ago

I need toworkaround code errors by using eslint disabling comments. Currently I try to workaround volar errors about types using beforeDownload. (any, unknown and never are forbidden types)

MateuszStawski commented 1 year ago

Hi, could you share your workaround?

MartinX3 commented 1 year ago

Hi, my workaround is to throw it away and rebuild a form in plain html.

MateuszStawski commented 1 year ago

Thanks for your reply.

I had a problem that in Typescript there was no type declared of Vue3Html2pdf, one solution found was to change a file inside node_modules file, but it would be overridden after npm install so it was temporary solution. What I did in the meantime and did work was to add extra comments above the template. Easiest solution was most useful.

    <!-- eslint-disable-next-line @typescript-eslint/ban-ts-comment -->
    <!-- @ts-ignore -->
    <!-- @vue-ignore -->
    <Vue3Html2pdf :show-layout="false" :float-layout="true" :enable-download="true" :preview-modal="false"
     <!--        the rest of the code.... -->