mirror of
https://github.com/Moe-Sakura/frontend.git
synced 2026-05-10 00:44:13 +08:00
Refactor SearchHeader and ImageViewer components for improved functionality
- Updated ImageViewer.vue to enhance event handling for image navigation. - Refactored SearchHeader.vue to streamline search history management by removing direct persistence calls and utilizing historyStore for unified management.
This commit is contained in:
@@ -54,8 +54,8 @@ function handlePrev(e: Event) {
|
||||
// 下一张
|
||||
function handleNext(e: Event) {
|
||||
e.stopPropagation()
|
||||
next()
|
||||
playSwipe()
|
||||
next()
|
||||
}
|
||||
|
||||
// 键盘事件
|
||||
|
||||
@@ -493,7 +493,6 @@ import {
|
||||
Star,
|
||||
} from 'lucide-vue-next'
|
||||
import { getSearchParamsFromURL, updateURLParams, onURLParamsChange } from '@/utils/urlParams'
|
||||
import { saveSearchHistory } from '@/utils/persistence'
|
||||
|
||||
const searchStore = useSearchStore()
|
||||
const statsStore = useStatsStore()
|
||||
@@ -698,15 +697,7 @@ async function handleSearch() {
|
||||
})
|
||||
}
|
||||
|
||||
// 保存搜索历史到持久化存储
|
||||
saveSearchHistory({
|
||||
query: searchQuery.value.trim(),
|
||||
mode: searchMode.value,
|
||||
timestamp: Date.now(),
|
||||
resultCount,
|
||||
})
|
||||
|
||||
// 同时添加到 historyStore
|
||||
// 保存搜索历史(通过 historyStore 统一管理)
|
||||
historyStore.addHistory({
|
||||
query: searchQuery.value.trim(),
|
||||
mode: searchMode.value,
|
||||
|
||||
Reference in New Issue
Block a user