feat: make navigation use native links (#973)

This commit is contained in:
Maxim Kirilyuk
2026-05-24 19:13:42 +08:00
committed by GitHub
parent e743c81ad3
commit acdf18793c
20 changed files with 419 additions and 46 deletions
@@ -0,0 +1,23 @@
import { reactive } from 'vue'
export function usePersistentRecord(key: string) {
let initial: Record<string, boolean> = {}
if (typeof window !== 'undefined') {
try {
const raw = window.localStorage.getItem(key)
if (raw) initial = JSON.parse(raw)
} catch {
initial = {}
}
}
const record = reactive<Record<string, boolean>>({ ...initial })
function persist() {
if (typeof window === 'undefined') return
window.localStorage.setItem(key, JSON.stringify({ ...record }))
}
return { record, persist }
}