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

后端 未结 7 1257
天涯浪人
天涯浪人 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

    ($('.selector') ).function();
    

    Ex: date picker initialize using jquery

    ($('.datepicker') ).datepicker();
    

提交回复
热议问题