import { Component, OnInit } from '@angular/core'; import { NavController } from '@ionic/angular'; // import Swiper from 'swiper'; import { Router } from '@angular/router'; import Parse from 'parse'; import { ParseService } from 'src/app/services/parse.service'; @Component({ selector: 'app-moreplace', templateUrl: './moreplace.page.html', styleUrls: ['./moreplace.page.scss'], }) export class MoreplacePage implements OnInit { constructor(private navCtrl: NavController,private router: Router,private parseService: ParseService) { } ngOnInit() { } search() { this.router.navigate(['/search']); // 替换成你的 setting 页面路由路径 } fetchMoreplace(){ } firstCol: HTMLElement |null = null; //点击变蓝 filterByCategory(event: any,category: string) { const selectedCol = event.target; const allCols = document.querySelectorAll('ion-col'); if (!this.firstCol) { this.firstCol = document.querySelector('ion-col:first-child'); if (this.firstCol) { this.firstCol.classList.add('blue'); } } else if (this.firstCol) { this.firstCol.classList.remove('blue'); } allCols.forEach(col => col.classList.remove('blue')); selectedCol.classList.add('blue'); this.firstCol = selectedCol; } }