diff options
Diffstat (limited to 'components/editor/quest/modal/Yaml.vue')
| -rw-r--r-- | components/editor/quest/modal/Yaml.vue | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/components/editor/quest/modal/Yaml.vue b/components/editor/quest/modal/Yaml.vue deleted file mode 100644 index 365055c..0000000 --- a/components/editor/quest/modal/Yaml.vue +++ /dev/null @@ -1,59 +0,0 @@ -<script setup lang="ts"> -import { stringify } from 'yaml'; -import { mapJsonQuestToYamlObject } from '~/lib/questsLoader'; - -const emit = defineEmits(['delete']); -const props = defineProps({ - questId: { - required: true, - type: String - }, -}); - -const session = useSessionStore(); - -const showModal = ref(false); -const yamlString = ref(''); - -const open = () => { - const quest = session.getQuestById(props.questId); - if (!quest) { - return - } - const mappedObject = mapJsonQuestToYamlObject(quest); - yamlString.value = stringify(mappedObject); - showModal.value = true; -} - -defineExpose({ - open -}) -</script> - -<template> - <Modal v-model="showModal"> - <template v-slot:header> - <h2>YAML</h2> - </template> - - <p>YAML file for <code>{{ props.questId }}</code></p> - - <textarea rows="20" :value="yamlString" readonly /> - - <div id="confirm" class="control-group"> - <Button type="solid" :icon="['fas', 'check']" :label="'Close'" @click="showModal = false"></Button> - </div> - </Modal> -</template> - -<style scoped> -#confirm { - display: flex; - justify-content: flex-end; - margin-top: 1rem; -} - -textarea { - width: 100%; -} -</style>
\ No newline at end of file |
