【发布时间】:2020-07-06 19:52:24
【问题描述】:
我尝试在 TypeScript 中使用敲除,我认为我遇到了与 here 相同的问题,但我找不到需要安装的类型。代码行是:
ko.extenders.name = function (target : string) {
错误是:
error TS2339: Property 'name' does not exist on type 'KnockoutExtenders'.
我该如何解决这个问题?
我的代码中的其他相同类型的错误是:
error TS2339: Property 'number' does not exist on type 'KnockoutExtenders'.
和
error TS2339: Property 'modal' does not exist on type 'JQuery<HTMLElement>'.
代码
$('#signup-dialog').modal('show');
【问题讨论】:
-
看起来像是 knockoutjs
KnockoutExtenders类型没有name,也没有number属性 @types/knockoutjs。对于.modal,您肯定需要导入特定的plugin
标签: typescript typescript-typings knockout-3.0