JQuery intellisense in Visual Studio Code

后端 未结 7 786
粉色の甜心
粉色の甜心 2020-12-13 11:26

I decided to jump in Visual Studio Code to create an app.
Now I can\'t seem to get intellisense working for both JQuery and JQuery Mobile.

My VSC version is 0.10

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 11:55

    I had a little bit problem with it, so I would like to share the solution that worked for me. At first you need in project root package.json if you don't have it in console simply type:

    $ npm init
    

    this command should create a package.json with necessary content in it. Then run this command in console:

    $ npm install --save @types/jquery
    

    and like @oldbam said before use automatic type acquisition: by creating jsonconfig.json with code below:

        {
     "typeAcquisition": {
         "include": [
             "jquery"
         ]
       }
    }
    

提交回复
热议问题