🐛 Fix malformed YAML in export menu (#482)

This commit is contained in:
Alicia Sykes 2022-02-09 18:27:48 +00:00
parent c4f1be2b76
commit 86837105cf
2 changed files with 8 additions and 14 deletions

View File

@ -65,7 +65,6 @@
<script>
import JsonToYaml from '@/utils/JsonToYaml';
import { localStorageKeys, modalNames } from '@/utils/defaults';
import { getUsersLanguage } from '@/utils/ConfigHelpers';
import StoreKeys from '@/utils/StoreMutations';
@ -88,7 +87,6 @@ export default {
name: 'ConfigContainer',
data() {
return {
jsonParser: JsonToYaml,
backupId: localStorage[localStorageKeys.BACKUP_ID] || '',
appVersion: process.env.VUE_APP_VERSION,
latestVersion: '',
@ -101,9 +99,6 @@ export default {
sections: function getSections() {
return this.config.sections;
},
yaml() {
return this.jsonParser(this.config);
},
},
components: {
JsonEditor,

View File

@ -1,9 +1,9 @@
<template>
<pre><code>{{ jsonParser(config) }}</code></pre>
<pre><code>{{ yamlConfig }}</code></pre>
</template>
<script>
import JsonToYaml from '@/utils/JsonToYaml';
import JsYaml from 'js-yaml';
export default {
name: 'DownloadConfig',
@ -11,11 +11,9 @@ export default {
config() {
return this.$store.state.config;
},
},
data() {
return {
jsonParser: JsonToYaml,
};
yamlConfig() {
return JsYaml.dump(this.config);
},
},
};
@ -23,8 +21,9 @@ export default {
<style scoped lang="scss">
pre {
background: var(--code-editor-background);
color: var(--code-editor-color);
margin: 0;
padding: 1rem;
color: var(--code-editor-color);
background: var(--code-editor-background);
}
</style>