Layout_Rank.ts 820 B

12345678910111213141516171819202122232425262728293031323334
  1. import { _decorator, Button, Component, Node, Toggle } from 'cc';
  2. import List from 'db://assets/core/util_comp/List';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('Layout_Rank')
  5. export class Layout_Rank extends Component {
  6. @property(Button)
  7. Close_Btn: Button;
  8. @property(Toggle)
  9. Rank_Toggle_1: Toggle;
  10. @property(Toggle)
  11. Rank_Toggle_2: Toggle;
  12. //列表
  13. @property(List)
  14. list1: List = null;
  15. //列表
  16. @property(List)
  17. list2: List = null;
  18. public onList1: Function;
  19. public onList2: Function;
  20. onListRender1(item: any, idx: number) {
  21. this.onList1?.(item, idx);
  22. }
  23. onListRender2(item: any, idx: number) {
  24. this.onList2?.(item, idx);
  25. }
  26. protected onDestroy(): void {
  27. this.onList1 = null;
  28. this.onList2 = null;
  29. }
  30. }