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