Skip to content

Commit

Permalink
docs(useStorage): fix some demo error (#3315)
Browse files Browse the repository at this point in the history
Co-authored-by: 大伟 <madawei109079@ehousechina.com>
  • Loading branch information
flyMDW and 大伟 committed Aug 23, 2023
1 parent 48f4c6e commit 192bb54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/useStorage/index.md
Expand Up @@ -56,8 +56,8 @@ const state = useStorage(
{ mergeDefaults: true } // <--
)

console.log(state.hello) // 'nihao', from storage
console.log(state.greeting) // 'hello', from merged default value
console.log(state.value.hello) // 'nihao', from storage
console.log(state.value.greeting) // 'hello', from merged default value
```

When setting it to true, it will perform a **shallow merge** for objects. You can pass a function to perform custom merge (e.g. deep merge), for example:
Expand Down

0 comments on commit 192bb54

Please sign in to comment.