Cov txheej txheem:

Koj hloov TypeScript li cas hauv Visual Studio code?
Koj hloov TypeScript li cas hauv Visual Studio code?

Video: Koj hloov TypeScript li cas hauv Visual Studio code?

Video: Koj hloov TypeScript li cas hauv Visual Studio code?
Video: Qhia saib seb yus tu hlub комментарий thiab nias like rau leej twg 2021 2024, Kaum ib hlis
Anonim

Hloov lub zos TypeScript version

  1. Qhib qhov project hauv VS Code .
  2. Nruab qhov xav tau TypeScript version hauv zos, piv txwv li npm nruab --save-dev ntaus ntawv @2.0.5.
  3. Qhib VS Code Chaw Chaw Ua Haujlwm (F1> Qhib Chaw Ua Haujlwm Chaw Ua Haujlwm)
  4. Hloov tshiab /Insert " ntaus ntawv .tsdk": "./node_modules/ ntaus ntawv /lib"

Raws li txoj cai, kuv yuav teeb tsa TypeScript hauv Visual Studio code li cas?

Hloov TypeScript rau hauv JavaScript

  1. Kauj ruam 1: Tsim ib daim ntawv TS yooj yim. Qhib VS Code ntawm qhov khoob khoob thiab tsim lub ntiaj teb nyob zoo.
  2. Kauj ruam 2: Khiav lub TypeScript tsim. Khiav Tsim Ua Haujlwm (Ctrl + Ua haujlwm + B) los ntawm lub ntiaj teb Terminal ntawv qhia zaub mov.
  3. Kauj ruam 3: Ua tus TypeScript Tsim lub neej ntawd.
  4. Kauj Ruam 4: Tshawb xyuas cov teeb meem tsim.

Ib tug kuj yuav nug, Kuv yuav qhib TypeScript project li cas hauv Visual Studio code? Tsim ib daim nplaub tshev khoob, qhib Visual Studio Code thiab txav mus rau lub nplaub tshev ntawd. Tam sim no peb xav teeb tsa tus txheej txheem tsim kom yooj yim thiaj li khiav tau qhov project nrog ob peb khawm. Nias Ctrl + Ua haujlwm + P thiab ntaus Configure Task Runner, nias Enter los xaiv nws TypeScript -tsconfig. json.

Tom qab ntawd, lo lus nug yog, koj yuav hloov kho TypeScript li cas?

Sim npm install -g ntaus ntawv @latest. Koj tuaj yeem siv npm hloov tshiab es tsis txhob nruab, tsis muaj qhov hloov kho tshiab. Qhov no yuav nruab qhov tseeb ntaus ntawv version yog tsis tau ntsia, txwv tsis pub nws yuav hloov tshiab lub installation tam sim no mus rau qhov tseeb version.

Kuv yuav nrhiav tau kuv lub zos TypeScript version li cas?

Lub -g txhais tau tias nws tau nruab rau hauv koj lub cev thoob ntiaj teb kom cov TypeScript compiler tuaj yeem siv rau hauv ib qho ntawm koj qhov project. Kuaj tias cov TypeScript yog ntsia kom raug los ntawm kev ntaus ntawv tsc -v nyob rau hauv koj lub davhlau ya nyob twg lossis hais kom ua. Koj yuav tsum saib TypeScript version luam tawm mus rau qhov screen.

Pom zoo: