diff --git a/src/runtime/composables/usePersistence.ts b/src/runtime/composables/usePersistence.ts index 97a6a06..7caef4d 100644 --- a/src/runtime/composables/usePersistence.ts +++ b/src/runtime/composables/usePersistence.ts @@ -38,14 +38,14 @@ function usePersistence | Reactive>(item: T, key?: strin if (isRef(item)) { itemType.value = 'ref'; - if (route.query[key || 'test']) { - item.value = route.query[key || 'test'] as UnwrapRef; + if (route.query[key]) { + item.value = route.query[key] as UnwrapRef; } watch(item, () => { const newQ = { ...route.query, - [key || 'test']: JSON.parse(JSON.stringify(item.value)) + [key]: JSON.parse(JSON.stringify(item.value)) }; router.push({ query: newQ });