import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { Router } from '@angular/router';

@Component({
  selector: 'app-search',
  templateUrl: './search.page.html',
  styleUrls: ['./search.page.scss'],
})

export class SearchPage {
  hotSearches: string[] = ['JavaScript', 'Angular', 'Ionic', 'TypeScript'];
  searchHistory: string[] = ['React', 'Vue', 'Node.js'];

  search() {
    // 实现搜索功能的逻辑
  }

  deleteHistoryItem(item: string) {
    const index = this.searchHistory.indexOf(item);
    if (index > -1) {
      this.searchHistory.splice(index, 1);
    }
  }

  deleteAllHistory() {
    this.searchHistory = [];
  }
}
