tab2.page.ts 713 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { Component, OnInit } from '@angular/core';
  2. import Parse from "parse";
  3. @Component({
  4. selector: 'app-tab2',
  5. templateUrl: 'tab2.page.html',
  6. styleUrls: ['tab2.page.scss']
  7. })
  8. export class Tab2Page implements OnInit{
  9. currentTab:string = "recommend"
  10. constructor() {}
  11. onClick(){
  12. alert("666")
  13. }
  14. ngOnInit() {
  15. this.loadNovels()
  16. }
  17. novelList:Array<Parse.Object> = []
  18. async loadNovels(){
  19. let query = new Parse.Query("NovelInformation");
  20. let list = await query.find();
  21. this.novelList = list
  22. }
  23. maleBooks = [
  24. { title: '三体' },
  25. { title: '流浪地球' }
  26. ];
  27. femaleBooks = [
  28. { title: '何以笙箫默' },
  29. { title: '步步惊心' }
  30. ];
  31. }