VS Code中的jQuery intellisense [英] jQuery intellisense in VS Code
问题描述
我已经尝试过了:
Visual Studio Code中的JQuery智能感知
和这个:
http://shrekshao.github.io/2016/06/20/vscode-01/
但是它什么也没做,VS Code不会添加jquery intellisense,我已经尝试解决了好几个小时了,但是它却无法正常工作
But it does nothing, VS Code just won't add jquery intellisense, I've been trying to solve this for hours but it just won't work
推荐答案
大多数博客帖子现在已过时,因为我们终于有了1.8+版的自动类型获取功能-您不再需要自己安装键入内容.
Most of the blog postings are now outdated, as we finally have automatic type acquisition with version 1.8+ - you no longer need to install the typings yourself.
我建议您阅读官方文档,该文档始终是最新的: https://code.visualstudio.com/docs/languages/javascript
I recommend reading the official documentation, its always up to date: https://code.visualstudio.com/docs/languages/javascript
如果您使用npm并在项目中包含 package.json
,并且jQuery列在其中,则它应该已经可以工作.
If you use npm and have a package.json
in your project and jQuery is listed there, it should already work.
如果您不使用npm,则可以在项目根目录中创建文件 jsconfig.json
,其中包含以下内容,您可以使用:
If you do not use npm, you can create the file jsconfig.json
in the project root with the following content and you are good to go:
{
"typeAcquisition": {
"include": [
"jquery"
]
}
}
这篇关于VS Code中的jQuery intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!