46 lines
881 B
Vue
46 lines
881 B
Vue
<script setup>
|
|
|
|
import {onMounted, reactive} from "vue";
|
|
import {setDefaultData} from "src/composables/form/formHandling";
|
|
import FormWrapper from "components/FormWrapper.vue";
|
|
import {commonProps} from "src/composables/inputs";
|
|
import {isRequired} from "src/composables/form/rules";
|
|
|
|
const props = defineProps({
|
|
organization: {
|
|
type: Object
|
|
},
|
|
isRequestPending: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
}
|
|
})
|
|
|
|
const formData = reactive({
|
|
name: null,
|
|
});
|
|
|
|
const rules = {
|
|
name: [isRequired]
|
|
}
|
|
|
|
onMounted(() => {
|
|
if (props.organization) {
|
|
setDefaultData(formData, props.organization);
|
|
}
|
|
})
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<FormWrapper v-model="formData" :is-request-pending="props.isRequestPending">
|
|
<q-input
|
|
v-bind="commonProps"
|
|
label="Jméno"
|
|
:rules="rules.name"
|
|
v-model="formData.name"
|
|
/>
|
|
</FormWrapper>
|
|
</template>
|