error TS1219: Experimental support for decorators is a feature

在sublime 下 编辑typescript的decorator,

class Test{
    @Override1('test')
    name:string = 'pat';
}

进行编译时,报以下错误:

error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

解决方法:
在编译命令后加上编译参数:

"cmd": ["tsc.cmd", "$file","--experimentalDecorators","--emitDecoratorMetadata"]

版权声明:本文为u012038649原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。