diff --git a/src/app/query/query.component.ts b/src/app/query/query.component.ts index f83b272e77..14daeca6e4 100644 --- a/src/app/query/query.component.ts +++ b/src/app/query/query.component.ts @@ -5,7 +5,15 @@ import { MatCardModule } from '@angular/material/card'; import { MatListModule } from '@angular/material/list'; import { MatToolbarModule } from '@angular/material/toolbar'; import { ActivatedRoute, RouterLink } from '@angular/router'; -import { Observable, combineLatest, defer, filter, map, startWith, switchMap } from 'rxjs'; +import { + Observable, + combineLatest, + defer, + filter, + map, + startWith, + switchMap, +} from 'rxjs'; import { SitePostService } from '../site-common/site-post.service'; @Component({ @@ -25,7 +33,7 @@ import { SitePostService } from '../site-common/site-post.service'; -

共 {{ searchResult.length }} 篇文章

+

共 {{ searchResult().length }} 篇文章

@if (searchDateStart()) { @@ -106,7 +114,7 @@ export class QueryComponent { private route = inject(ActivatedRoute); private searchKeyword$ = this.route.queryParamMap.pipe( - map((queryParamMap) => `${queryParamMap.get('q')}`), + map((queryParamMap) => queryParamMap.get('q')), filter(Boolean), startWith('') );