36 lines
891 B
Vue
36 lines
891 B
Vue
<script setup>
|
|
import {onMounted, ref} from "vue";
|
|
import FormWrapper from "components/FormWrapper.vue";
|
|
import {setDefaultData} from "src/composables/form/formHandling";
|
|
import RichTextEditor from "components/inputs/RichTextEditor.vue";
|
|
import {commonProps} from "src/composables/inputs";
|
|
|
|
const props = defineProps({
|
|
flight: {
|
|
type: Object,
|
|
required: false
|
|
},
|
|
});
|
|
|
|
const formData = ref({
|
|
name: "",
|
|
description: ""
|
|
})
|
|
|
|
const isMounted = ref(false);
|
|
onMounted(() => {
|
|
if (props.flight)
|
|
setDefaultData(formData.value, props.flight);
|
|
|
|
isMounted.value = true;
|
|
})
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<FormWrapper v-model="formData" v-if="isMounted">
|
|
<q-input type="text" v-model="formData.name" label="Jméno letu" v-bind="commonProps" />
|
|
<RichTextEditor v-model="formData.description" v-bind="commonProps" label="Popis letu, poznámky, ..." />
|
|
</FormWrapper>
|
|
</template>
|