美文网首页
Experimental support for decorat

Experimental support for decorat

作者: 贺子微 | 来源:发表于2020-12-04 15:43 被阅读0次

 React写class组件时遇到如下警告

配置装饰器解决experimentalDecorators警告问题

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.

解决方法:

1.在vscode设置中配置

勾选

2.在项目根目录新建jsconfig.json,添加代码

{

  "compilerOptions": {

    "experimentalDecorators": true

  }

}

重启项目就可以了

相关文章

网友评论

      本文标题:Experimental support for decorat

      本文链接:https://www.haomeiwen.com/subject/tdliwktx.html