版本
1.50.1(中文简体插件)
报错内容
对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig” 或 “jsconfig” 中设置 “experimentalDecorators” 选项以删除此警告
解决办法
-
方法一:设置VSCode选项
管理==>设置==>搜索experimentalDecorators==>打上勾勾
-
方法二:增加jsconfig文件
在根目录下新建jsconfig.json文件
{ "experimentalDecorators": true, // 主要是这个 "exclude": [ "node_modules", "dist" ], }
-
方法三:增加tsconfig文件
在根目录下新建tsconfig.json文件
{ "compilerOptions": { "experimentalDecorators": true, // 主要是这个 }, "exclude": ["node_modules"], "include": ["src"] }
注意:使用装饰器的js文件后缀需要修改成
.ts