How can I stop “property does not exist on type JQuery” syntax errors when using Typescript?

后端 未结 7 1235
天涯浪人
天涯浪人 2020-12-01 04:09

I am only using one line of jQuery in my application:

$(\"div.printArea\").printArea();

But this is giving me a Typescript error:

相关标签:
7条回答
  • 2020-12-01 04:52

    You can cast it to

    (<any>$('.selector') ).function();
    

    Ex: date picker initialize using jquery

    (<any>$('.datepicker') ).datepicker();
    
    0 讨论(0)
提交回复
热议问题