class Index { constructor(){ this.page = 1 this.bindEvent() this.getClassList() } bindEvent(){ click(".more",() => { this.page+=1 this.getClassList() } ) } async getClassList(){ var res = await ajax.get({ url: 'http://127.0.0.1:3000/api/index/class', data: { type: 1, page: this.page }, }); var data = res.result.items; data.forEach(v => { $("ul").innerHTML += `
  • ${v.title}

  • ` }); } } new Index();