0
点赞
收藏
分享

微信扫一扫

ts 学习1


npm install -g typescript

vscode写ts文件报错:

tsc -init  会在目录下生成一个tsconfig.json文件 可识别.ts文件

编译一个 TypeScript 文件很简单:

tsc hello.ts   编译后会自动生成对应的js文件

用 TypeScript 编写 React 时,以 .tsx 为后缀

ts报错时,编译后也可生成js文件,如果报错时不想生成文件,可在tsconfig.json设置noEmitOnError为false

 

 

 

 

举报

相关推荐

0 条评论