简体   繁体   中英

Does vscode support decorator after export default? How to let this enabled?

Like on the picture below, when I write export default @Decorator class, vscode told me the syntax is wrong. How can I remove this error?

vscode上的错误

Update:

Yes, I know there are a lot of answer about how to enable decorator in vscode, but I really would like how to enable the decorator after the export default .

I just add the configuration in jsconfig.jsonjsconfig.json . That's not work.

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

Try adding below code in config-overrides.js, for other configuration please check https://code.visualstudio.com/docs/languages/jsconfig#_jsconfig-options

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM