I am only using one line of jQuery in my application:
$("div.printArea").printArea();
但这给了我一个打字错误:
The property 'printArea' does not exist on type JQuery?
有人能告诉我怎样才能阻止这个错误的出现吗?
I am only using one line of jQuery in my application:
$("div.printArea").printArea();
但这给了我一个打字错误:
The property 'printArea' does not exist on type JQuery?
有人能告诉我怎样才能阻止这个错误的出现吗?
You could cast it to <any>
or extend the jquery typing to add your own method.
(<any>$("div.printArea")).printArea();
//或者添加您自己的自定义方法(假设这是您自己作为自定义插件的一部分添加的)
interface JQuery {
printArea():void;
}