2017-08-04 96 views
-3

我在打字稿integre jQuery的,但我有此错误:Integre的Jquery在打字稿

error TS2304: Cannot find name 'JQueryStatic'.

config.json:

{ 
    "compilerOptions": { 
     "target": "es5", 
     "pretty": true, 
     "experimentalDecorators":true 
    }, 

    "files": [ 
     "demo.ts", 
     "typings/index.d.ts" 
    ], 

    "excluse": ["node_modules"] 
} 

demo.ts:

declare var $: JQueryStatic; 

$('.test').click(function(eventObject){ 
    alert('hello'); 
}) 

这是我的项目的屏幕:

enter image description here

+0

这听起来像打字稿编译不包括.d.ts文件jQuery的;不知道为什么。 – libertyernie

回答