Use YAML parser instead of JSON for deck input

This commit is contained in:
Adam Goldsmith 2019-01-03 21:12:16 +01:00
parent d25da968c4
commit c6853200ab
2 changed files with 3 additions and 3 deletions

View File

@ -14,6 +14,7 @@
"dependencies": {
"express": "^4.16.4",
"interactjs": "^1.3.4",
"js-yaml": "^3.12.0",
"nedb-promises": "^3.0.2",
"parcel-bundler": "^1.11.0",
"phantom": "^4.0.12",

View File

@ -52,6 +52,7 @@
</template>
<script>
import yaml from 'js-yaml';
import Deck from './Deck.vue';
export default {
@ -90,9 +91,7 @@
jsonUpload(event) {
let files = event.target.files;
let reader = new FileReader();
reader.onload = event => {
this.deckInfo = JSON.parse(event.target.result);
};
reader.onload = e => this.deckInfo = yaml.safeLoad(e.target.result);
reader.readAsText(files[0]);
},