diff --git a/src/App.vue b/src/App.vue index a639ae9..d08e14a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,8 +13,15 @@ - - + +
+ + +
+ + + + @@ -27,10 +34,32 @@ import {ref} from 'vue' const scenes = ref([]) const title = ref('') const add = () => { - scenes.value.push(title.value) + scenes.value.push({ + title: title.value, + series: [] + }) title.value = "" } +const load = (e) => { + let files = e.target.files + new Promise.all(files.forEach(async (file) =>{ + const reader = new FileReader() + reader.readAsText(file) + reader.onloadend = (e) => { + if (e.target.readyState == FileReader.DONE) { + try { + let scene = JSON.parse(reader.result) + scenes.value.push(scene) + } catch (e) { + console.log(e) + } + } + } + }) + ) +} +