当前位置: 代码迷 >> 综合 >> [typescript] Experimental support for decorators is a feature
  详细解决方案

[typescript] Experimental support for decorators is a feature

热度:89   发布时间:2023-12-12 01:13:51.0

error

用到typescrip装饰器语法,使用命令tsc进行编译时,报错如下

Experimental support for decorators is a feature that is subject to change in a future release.
Set the ‘experimentalDecorators’ option in your ‘tsconfig’ or ‘jsconfig’ to remove this warning.

根据提示信息,看了下我实际的配置文件tsconfig.json,已经包含experimentalDecorators:true

resolution

一个解决办法使用experimentalDecorators选项:
tsc ./src/libs/common.ts --experimentalDecorators

  相关解决方案