|
@@ -3,6 +3,7 @@ import { Component, OnInit } from '@angular/core';
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
import { FormsModule } from '@angular/forms';
|
|
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
|
+import { RouterModule } from '@angular/router';
|
|
|
import {
|
|
|
faArrowLeft,
|
|
|
faSearch,
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
@Component({
|
|
|
selector: 'app-image-search',
|
|
|
standalone: true,
|
|
|
- imports: [CommonModule, FormsModule, FontAwesomeModule],
|
|
|
+ imports: [CommonModule, FormsModule, FontAwesomeModule,RouterModule],
|
|
|
templateUrl: './image-search.html',
|
|
|
styleUrls: ['./image-search.scss']
|
|
|
})
|
|
@@ -71,10 +72,6 @@ export class ImageSearchComponent implements OnInit {
|
|
|
this.searchHistory = history ? JSON.parse(history) : [];
|
|
|
}
|
|
|
|
|
|
- backAction() {
|
|
|
- // 实际应用中这里应该是 router.navigate 或其他导航逻辑
|
|
|
- alert('返回上一页面');
|
|
|
- }
|
|
|
|
|
|
clearHistory() {
|
|
|
if (this.searchHistory.length === 0) return;
|