【发布时间】:2016-02-09 04:22:45
【问题描述】:
是否可以包含 jquery.d.ts 并使用 jQueryStatic 类型?我需要类似的东西
...
protected el : jQueryStatic;
...
无论如何我都无法从https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/jquery导入jQueryStatic接口
非常感谢。
更新
/// <reference path="../../../../defs/jquery.d.ts" />
error TS2304: Cannot find name 'jQuery'.
/// <reference path="../../../../defs/jquery.d.ts" />
import {jQuery} from 'jquery';
error TS2305: Module '"jquery"' has no exported member 'jQuery'.
更新
工作解决方案是添加类型 JQuery 而不是 jQuery。
/// <reference path="../../../defs/jquery.d.ts" />
...
protected $el: JQuery;
【问题讨论】:
标签: javascript typescript