class Myinfo { constructor() { header("我的收藏", ` `); this.res = localStorage.getItem("likeArr")==null ? [] : JSON.parse(localStorage.getItem("likeArr")) this.getType() } getType() { if (this.res == 0) { $(".content").innerHTML += `

暂无收藏

` } else { this.res.forEach(v => { $(".content_ddd").innerHTML+=`
  • ${v.total}
    ${v.title}儿
    ${v.info}
    ${v.source}
  • ` }); } } } new Myinfo()