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

发布了180 篇原创文章 · 获赞 36 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/weixin_38404899/article/details/103718941
ts
今日推荐