jquery - 类型 “jQueryStatic<TElement extends Node>” 的值不可调用

标签 jquery typescript visual-studio-2017 resharper definitelytyped

问题: Visual Studio IntelliSense 在 $ 处大喊: Value of type “jQueryStatic<TElement extends Node>” is not callable

示例代码($ 的所有实例,真的):

const emaildiv = $("<div>", { "class": "email-item" });
$(containerid).append(emaildiv);

设置:

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>

一切都构建并运行良好。有人知道吗?

最佳答案

事实证明,问题又出在 Resharper 上 (Value of type "JqueryStatic" is not callable)。这是我所做的一切的列表:

关于jquery - 类型 “jQueryStatic<TElement extends Node>” 的值不可调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46208434/

相关文章:

javascript - slideToggle() 问题

jquery - 向下滚动时如何构建 float 菜单栏

angular - 如何使用 Yarn 而不是 Npm 发布我的 Visual Studio Angular 项目?

jquery UI 可拖动 : horizontal dragging inside of container with overflow:scroll?

javascript - 如何使用 Javascript 检测类中的哪个元素被单击?

javascript - 为什么按钮不打开按下按钮的模式?

javascript - 如何测试 JavaScript 对象文字是否具有与 TypeScript 类相同的属性?

TypeScript 泛型类型的泛型类型

visual-studio - 如何在 Visual Studio 2017 中运行 NUnit 测试?

c++ - vs2017 输出错误但 mingw 有效