html52.com
我爱小程序-开发者交流社区

请问开发者工具如何一键生成get/set 方法?

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)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付