Use YAML parser instead of JSON for deck input
This commit is contained in:
parent
d25da968c4
commit
c6853200ab
@ -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",
|
||||
|
@ -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]);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user