如果我在webstorm中写这样的代码
export class someOne {
constructor(param) {
this.test = param;
}
useTest(){
return this.test;
}
}
console.log(new someOne(123).useTest());
将鼠标悬停在“this.test”上,我看到警告:“元素未导出”
这是什么意思?
如果我将 .test
更改为 .test1
警告就会消失
最佳答案
对我来说,它可以用带前缀的下划线标记所有“私有(private)”属性。显然 Webstorm/IntelliJ 认为这些属性是不应该导出的。
export class someOne {
constructor(param) {
this._test = param;
}
useTest(){
return this._test;
}
}
console.log(new someOne(123).useTest());
关于javascript - webstorm: "Element is not exported"警告是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36670910/