打字稿:找不到JQueryUI ......即使它可以

时间:2016-01-08 21:42:56

标签: typescript

我正在尝试开始使用 var MyCompi=React.createClass({ getInitialState: function() { return{ rows : [{"id":1,"first_name":"William","last_name":"Elliott","email":"welliott0@wisc.edu", "country":"Argentina","ip_address":"247.180.226.89"}, {"id":2,"first_name":"Carl","last_name":"Ross","email":"cross1@mlb.com", "country":"South Africa","ip_address":"27.146.70.36"}, {"id":3,"first_name":"Jeremy","last_name":"Scott","email":"jscott2@cbsnews.com", "country":"Colombia","ip_address":"103.52.74.225"}] }; }, render:function(){ return( <Table height={this.state.rows.length * 300} width={1150} rowsCount={this.state.rows.length} rowHeight={30} headerHeight={30} rowGetter={function(rowIndex) {return this.state.rows[rowIndex]; }}> <Column dataKey="id" width={50} label="Id" /> <Column dataKey="first_name" width={200} label="First Name" /> <Column dataKey="last_name" width={200} label="Last Name" /> </Table> ); } }); ReactDOM.render(<MyCompi/> , document.getElementById('root') ); ,并且Typescript的定义存在很大问题。我有来自 DefinitelyTyped jQueryUI。它住在jqueryui.d.ts就好了。

我有一个文件/scripts/typings/jqueryui/jqueryui.d.ts,在顶部我有这一行;

documents.ts

但是,我仍然无法使用任何东西。我正在尝试使用///<reference path="~/Scripts/typings/jqueryui/jqueryui.d.ts"/>小部件;

Resizable

我不断被告知“找不到JQueryUI”。我有什么可以做的吗?

1 个答案:

答案 0 :(得分:0)

jqueryui.d.ts的路径必须相对于document.ts

///<reference path="relative/path/to/typings/jqueryui/jqueryui.d.ts"/>

[Spec]