typescript 用name作为变量名报错的原因 typescript 将 DOM typings 作为全局的运行环境,所以当我们声明 name 时, 与 DOM 中的全局 window 对象下的 name 属性出现了重名 解决方案 末尾加 export {} 题外话 如果是利用框架集成的话 tconfig.json 文件中 { "compilerOptions": { "lib": [ "es2015" ] } }