Skip to content

Commit

Permalink
remove unused key default value
Browse files Browse the repository at this point in the history
  • Loading branch information
YsarocK committed Sep 2, 2024
1 parent 16db121 commit 4db38d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/composables/usePersistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ function usePersistence<T extends Ref<any> | Reactive<any>>(item: T, key?: strin
if (isRef(item)) {
itemType.value = 'ref';

if (route.query[key || 'test']) {
item.value = route.query[key || 'test'] as UnwrapRef<T>;
if (route.query[key]) {
item.value = route.query[key] as UnwrapRef<T>;
}

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 });
Expand Down

0 comments on commit 4db38d2

Please sign in to comment.