Experimental support for decorators is a feature that is subject to change in a future release. Set the ‘experimentalDecorators’ option to remove this warning.
编辑器竟然在自定义类哪里报了个红线的warning,于是我找到了如下的方法解决:
在项目目录下新建tsconfig.json文件,然后加入如下配置就可以完美解决了。
{
"compilerOptions": {
"experimentalDecorators": true,
"allowJs": true
}
}
重新打开vsc编辑器就不会显示那条红线了。
网友评论