vue-pdf icon indicating copy to clipboard operation
vue-pdf copied to clipboard

Import vue-pdf with typescript

Open Zaaaoo opened this issue 5 years ago • 6 comments
trafficstars

Hi,

I have a problem to import vue-pdf, the module is not found.

My project use TypeScript : image

Did I forget something? Do you have examples in TypeScript ?

Thanks.

Versions : - vue-pdf 4.1.0 - vue.js 2.6.12 - webpack 4.44.2

Zaaaoo avatar Oct 02 '20 15:10 Zaaaoo

Your situation is the same as mine. Did you solve the problem? After I executed the follows, I tried to import 'vue-pdf'. But, 'vue-pdf' was not found.

npm install --save vue-pdf

jimar884 avatar Oct 14 '20 13:10 jimar884

To solve my problem I done :

  • shims-vue.d.ts image

  • main.ts image

Zaaaoo avatar Oct 14 '20 14:10 Zaaaoo

Thank you. I'll try it.

jimar884 avatar Oct 14 '20 14:10 jimar884

@Zaaaoo your solution gives me Cannot find name 'pdf'.

sittingbool avatar Mar 11 '21 10:03 sittingbool

@Zaaaoo your solution gives me Cannot find name 'pdf'.

me too

bingyuea avatar Jun 22 '21 13:06 bingyuea

You should not write export default pdf. Just

vue-pdf-shims.d.ts

declare module 'vue-pdf'

adrianwix avatar Aug 12 '21 17:08 adrianwix