no direct binding to local storage
This commit is contained in:
parent
72a7ee8c95
commit
94f34e56d1
1 changed files with 5 additions and 3 deletions
|
@ -21,13 +21,15 @@ export default function useStarsyStorage(star, objects) {
|
|||
const currentName = ref('example')
|
||||
|
||||
function loadPreset(name) {
|
||||
return store.value[name]
|
||||
const jsonClone = JSON.stringify(store.value[name])
|
||||
const preset = JSON.parse(jsonClone)
|
||||
return preset
|
||||
}
|
||||
|
||||
function savePreset(star, objects) {
|
||||
const name = currentName.value
|
||||
store.value[name] = { star, objects }
|
||||
console.log('saved preset', name, store.value[name])
|
||||
const jsonClone = JSON.stringify({ star, objects})
|
||||
store.value[name] = JSON.parse(jsonClone)
|
||||
}
|
||||
|
||||
function deletePreset(name) {
|
||||
|
|
Loading…
Reference in a new issue