优化: 将本地存储从localStorage迁移至IndexedDB以支持更大数据量存储

This commit is contained in:
yuantao
2025-10-17 10:17:49 +08:00
parent ae375aee8c
commit 0a89eda20b
9 changed files with 505 additions and 530 deletions

View File

@@ -73,7 +73,7 @@ onMounted(() => {
// 加载预设的模拟数据
store.loadMockData()
} else {
// 从localStorage加载用户数据
// 从Storage加载用户数据
store.loadData()
}
})
@@ -102,8 +102,8 @@ const filteredNotes = computed(() => {
return store.notes.filter(note => {
// 先检查搜索条件
const matchesSearch = !lowerCaseQuery ||
(note.title && note.title.toLowerCase().includes(lowerCaseQuery)) ||
(note.content && note.content.toLowerCase().includes(lowerCaseQuery))
(note.title && typeof note.title === 'string' && note.title.toLowerCase().includes(lowerCaseQuery)) ||
(note.content && typeof note.content === 'string' && note.content.toLowerCase().includes(lowerCaseQuery))
if (!matchesSearch) return false

View File

@@ -45,7 +45,7 @@ const store = useAppStore()
const router = useRouter()
// 页面挂载时加载初始数据
// 从localStorage加载用户设置和便签数据
// 从Storage加载用户设置和便签数据
onMounted(() => {
store.loadData()
})