future #10

Merged
袁涛 merged 37 commits from future into main 2025-10-17 14:46:33 +08:00
9 changed files with 1385 additions and 684 deletions
Showing only changes of commit f2f3756cc0 - Show all commits

File diff suppressed because one or more lines are too long

View File

@@ -97,11 +97,13 @@ const trashNotesCount = computed(() => {
// 根据当前文件夹过滤便签
const filteredNotes = computed(() => {
// 预处理搜索查询,提高性能
const lowerCaseQuery = searchQuery.value.toLowerCase().trim()
const lowerCaseQuery = searchQuery.value?.toLowerCase().trim() || ''
return store.notes.filter(note => {
// 先检查搜索条件
const matchesSearch = !lowerCaseQuery || note.title.toLowerCase().includes(lowerCaseQuery) || note.content.toLowerCase().includes(lowerCaseQuery)
const matchesSearch = !lowerCaseQuery ||
(note.title && note.title.toLowerCase().includes(lowerCaseQuery)) ||
(note.content && note.content.toLowerCase().includes(lowerCaseQuery))
if (!matchesSearch) return false