tab1.page.ts 794 B

12345678910111213141516171819202122232425262728293031
  1. import { Component } from '@angular/core';
  2. @Component({
  3. selector: 'app-tab1',
  4. templateUrl: 'tab1.page.html',
  5. styleUrls: ['tab1.page.scss']
  6. })
  7. export class Tab1Page {
  8. selectedSegment: string = 'explore';
  9. constructor() {}
  10. segmentChanged(event: CustomEvent) {
  11. this.selectedSegment = event.detail.value;
  12. }
  13. // 在此处定义和初始化数据
  14. contentList = [
  15. { image: 'https://img.zcool.cn/community/01df555d65edcea8012187f4e41c2f.jpg@2o.jpg', title: '示例标题1', user: '用户A', likes: 10, comments: 5, tags: '标签1, 标签2' },
  16. { image: 'https://img.zcool.cn/community/01df555d65edcea8012187f4e41c2f.jpg@2o.jpg', title: '示例标题2', user: '用户B', likes: 20, comments: 8, tags: '标签3, 标签4' },
  17. // 添加更多示例数据
  18. ];
  19. }