class Demo {
constructor(title, desc, deposit, type, cover, video) {
this.title = title;
this.desc = desc;
this.deposit = deposit;
this.type = type;
this.cover = cover;
this.video = video;
}
}
如上面这个类,如何能像Java 编辑器一样,一键生成该对象的get/set ?难道要手写?
网友回复
stop eating:
不需要 get set
const user = new User()
user.name = 123
console.log(user.name)