aboutsummaryrefslogtreecommitdiff
path: root/src/components/export_import
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/export_import')
-rw-r--r--src/components/export_import/export_import.vue33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/components/export_import/export_import.vue b/src/components/export_import/export_import.vue
index 451a2668..20c6f569 100644
--- a/src/components/export_import/export_import.vue
+++ b/src/components/export_import/export_import.vue
@@ -1,12 +1,27 @@
<template>
-<div class="import-export-container">
- <slot name="before"/>
- <button class="btn" @click="exportData">{{ exportLabel }}</button>
- <button class="btn" @click="importData">{{ importLabel }}</button>
- <slot name="afterButtons"/>
- <p v-if="importFailed" class="alert error">{{ importFailedText }}</p>
- <slot name="afterError"/>
-</div>
+ <div class="import-export-container">
+ <slot name="before" />
+ <button
+ class="btn"
+ @click="exportData"
+ >
+ {{ exportLabel }}
+ </button>
+ <button
+ class="btn"
+ @click="importData"
+ >
+ {{ importLabel }}
+ </button>
+ <slot name="afterButtons" />
+ <p
+ v-if="importFailed"
+ class="alert error"
+ >
+ {{ importFailedText }}
+ </p>
+ <slot name="afterError" />
+ </div>
</template>
<script>
@@ -49,7 +64,7 @@ export default {
if (event.target.files[0]) {
// eslint-disable-next-line no-undef
const reader = new FileReader()
- reader.onload = ({target}) => {
+ reader.onload = ({ target }) => {
try {
const parsed = JSON.parse(target.result)
const valid = this.validator(parsed)