[英]TypeScript jQuery type definition
我正在將示例應用程序從TypeScript 2.3轉換為2.4,從jQuery 3.1.1轉換為3.2.1(顯然使用最新的類型定義)。
這是我的tsconfig.json:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"lib": [
"dom",
"es5",
"scripthost",
"es2015.iterable"
],
"strict": true
},
"exclude": [
"node_modules",
"wwwroot"
]
}
(我添加了如https://github.com/DefinitelyTyped/DefinitelyTyped/issues/17239中所述的庫)
這是我的packages.json:
{
"version": "1.0.0",
"name": "asp.net",
"private": true,
"dependencies": {
"jquery": "3.2.1"
},
"devDependencies": {
"@types/jquery": "*"
}
}
現在:我希望在TypeScript文件中,如果使用$,則應該獲得Intellisense等等。 但是我得到了一個編譯錯誤。
請注意:-我正在將VS2017 15.2與最新的TypeScript 2.4.1.0插件一起使用-我現在還不想使用ES6
我應該改變什么?
問題出在新的Visual Studio插件(版本2.4.1.0)中。 該解決方案可以從命令行編譯。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.