文章目录
02丨类型基础(1):强类型与弱类型
03丨类型基础(2):动态类型与静态类型
04丨编写你的第一个TypeScript程序
npm init -y
cnpm i typescript -g
TypeScript配置文件
tsc --init
编译文件
tsc ./src/index.ts
webpack配置
cnpm i ts-loader typescript -D
cnpm i html-webpack-plugin -D
# 每次构建成功,清空dist目录
cnpm i clean-webpack-plugin -D
# 两个配置文件合并
cnpm i webpack-merge -D
生成html模板文件
html:5
渲染页面
let hello : string = 'Hello ts!'
document.querySelectorAll('.app')[0].innerHTML = hello;