美文网首页
Error TS6138 - Property xxxx is

Error TS6138 - Property xxxx is

作者: _扫地僧_ | 来源:发表于2022-04-21 08:52 被阅读0次

    我有一段 TypeScript 代码:

    export class AppModule {
      constructor(private s: ActiveCartService){
        if( s === undefined){
          console.log(s);
        }
        s.isStable().subscribe((data) => console.log('isStable: ' , data));
      }
    }
    

    引起如下错误消息:

    Error TS6138 - Property xxxx is declared but its value is never read

    解决方法:

    修改 tsconfig.json:

    将下列参数改成 false 即可:

     "noUnusedLocals": false,
     "noUnusedParameters": false,
    

    问题解决:

    相关文章

      网友评论

          本文标题:Error TS6138 - Property xxxx is

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