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')
|
const currentName = ref('example')
|
||||||
|
|
||||||
function loadPreset(name) {
|
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) {
|
function savePreset(star, objects) {
|
||||||
const name = currentName.value
|
const name = currentName.value
|
||||||
store.value[name] = { star, objects }
|
const jsonClone = JSON.stringify({ star, objects})
|
||||||
console.log('saved preset', name, store.value[name])
|
store.value[name] = JSON.parse(jsonClone)
|
||||||
}
|
}
|
||||||
|
|
||||||
function deletePreset(name) {
|
function deletePreset(name) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue