36 lines
691 B
Vue
36 lines
691 B
Vue
<script setup>
|
|
import FormSubmitButton from "components/FormSubmitButton.vue";
|
|
|
|
const props = defineProps({
|
|
modelValue: {
|
|
type: Object,
|
|
},
|
|
isRequestPending: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
saveButton: {
|
|
type: [Object, Boolean],
|
|
required: false,
|
|
default: () => ({
|
|
label: "Uložit",
|
|
icon: "save",
|
|
align: "left"
|
|
})
|
|
}
|
|
});
|
|
|
|
const emits = defineEmits(["save"]);
|
|
const saveForm = () => {
|
|
emits("save", props.modelValue);
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<q-form @submit.prevent="saveForm" ref="form">
|
|
<slot name="default"/>
|
|
<FormSubmitButton v-if="saveButton" :save-button="saveButton"/>
|
|
</q-form>
|
|
</template>
|