vscode中使用Experimental Decorators报错

Posted zhiyingzhou

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vscode中使用Experimental Decorators报错相关的知识,希望对你有一定的参考价值。

 

在vscode中使用es7的新语法decorator会报错,如图:

 

 这是错误来自与vscode的JS support,只要在项目根目录下创建一个jsconfig.json文件,添加如下内容:

{
    "compilerOptions": {
        "experimentalDecorators": true
    }
}

添加好了有可能需要重启才能生效。

github原issue: https://github.com/Microsoft/vscode/issues/28097#issuecomment-306560817

以上是关于vscode中使用Experimental Decorators报错的主要内容,如果未能解决你的问题,请参考以下文章

VSCode launch.json配置详解

如何在 Typescript 输出中使用 node --experimental-modules

constexpr 函数内的 std::experimental::optional

在带有 @angular/cdk-experimental 的 Angular Material 2 表中使用虚拟滚动

如何使用 std::experimental::simd?

节点 --experimental-modules,请求的模块不提供名为的导出