安装

npm install -g typescript

编译

tsc index.ts

  • 该命令可以让ts文件转换为js文件

截图

typescript学习--安装与自动编译

hbuilder自动编译–已不行

  • 先到工具–插件安装–浏览eclipse插件市场
  • 在搜索栏输入typescript,等待搜索结束后,点击深紫色的原形typescript的install
  • 报错提示
    typescript学习--安装与自动编译

hbuilderx自动编译

  • 工具–插件安装,找到typescript编译和typescript语言服务
  • 两个都安装后,工具–插件配置,compile–typescript,package.json
  • 在package.json文件中找“onDidSaveExecution”设置为true
  • 再重新打开编辑器,就可以自动保存了
    typescript学习--安装与自动编译

相关文章:

  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2021-07-21
  • 2021-05-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-20
  • 2021-07-02
  • 2022-12-23
  • 2021-11-22
  • 2021-10-30
  • 2022-12-23
相关资源
相似解决方案