[js] 对修饰器的实验支持是一项将在将来版本中更改的功能。设置 "experimentalDecorators" 选项以删除此警告。
来源:3-4 store配置(2)

pino宋
2018-01-18
写回答
1回答
-
pino宋
提问者
2018-01-18
在VSCode中停止警告experimentalDecorators
问题:在下面的类中使用装饰器时,我们总是在VSCode中得到这个警告
class User {
@serializable(identifier()) id = 0
}警告信息:
[js] Experimental support for decorators is a feature that is subject to
change in a future release. Set the 'experimentalDecorators' option
to remove this warning.解决:
第一步:创建名为的新文件 tsconfig.json
第2步:将此json添加到文件
{
"compilerOptions": {
"experimentalDecorators": true,
"allowJs": true
}
}第三步:重新加载窗口
00
相似问题