问题: 的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