2017-08-04 31 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

回答