Use YAML parser instead of JSON for deck input
This commit is contained in:
parent
3573db0567
commit
e7006cfbea
@ -14,6 +14,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
"interactjs": "^1.3.4",
|
"interactjs": "^1.3.4",
|
||||||
|
"js-yaml": "^3.12.0",
|
||||||
"nedb-promises": "^3.0.2",
|
"nedb-promises": "^3.0.2",
|
||||||
"parcel-bundler": "^1.11.0",
|
"parcel-bundler": "^1.11.0",
|
||||||
"phantom": "^4.0.12",
|
"phantom": "^4.0.12",
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import yaml from 'js-yaml';
|
||||||
import Deck from './Deck.vue';
|
import Deck from './Deck.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -90,9 +91,7 @@
|
|||||||
jsonUpload(event) {
|
jsonUpload(event) {
|
||||||
let files = event.target.files;
|
let files = event.target.files;
|
||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
reader.onload = event => {
|
reader.onload = e => this.deckInfo = yaml.safeLoad(e.target.result);
|
||||||
this.deckInfo = JSON.parse(event.target.result);
|
|
||||||
};
|
|
||||||
reader.readAsText(files[0]);
|
reader.readAsText(files[0]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user