問題: 的Visual Studio智能感知罵$
:Value of type 「jQueryStatic<TElement extends Node>」 is not callable
值類型的「jQueryStatic <TElement延伸節點>」不是可調用
實施例代碼(的$
所有實例,真的):
const emaildiv = $("<div>", { "class": "email-item" });
$(containerid).append(emaildiv);
設置:
- 的Visual Studio 2017年
- 核心ASP.NET Web應用程序
- DefinitelyTyped jquery 3.2.1
- 的jQuery 3.2.1
- TS 2.3
- ReSharper的2017年1月3日
tsconfig.ts:
{
"compilerOptions": {
"lib": [ "es2015", "es2015.iterable", "dom" ],
"noImplicitAny": true,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5"
},
"files": [
// a bunch of local files...
],
"compileOnSave": true
}
米
的.csproj:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TypeScriptToolsVersion>2.3</TypeScriptToolsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<!-- other .ts files -->
<TypeScriptCompile Include="Scripts\Scripts.ts" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\scripts\" />
</ItemGroup>
</Project>
一切都建立並正常工作。任何人有任何線索?
您的'$'示例代碼中沒有調用。至少有一些括號或某處。請提供更多背景。 – recursive
@recursive添加示例代碼。 '$'的所有實例。 – Cescante