Ne uplne otestovany prepis storu
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import {isRequestPending} from "src/composables/form/props";
|
||||
import {computed, useSlots} from "vue";
|
||||
import {useQuasar} from "quasar";
|
||||
import FormSubmitButton from "components/FormSubmitButton.vue";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@@ -23,38 +24,11 @@ const emits = defineEmits(["save"]);
|
||||
const saveForm = () => {
|
||||
emits("save", props.modelValue);
|
||||
}
|
||||
|
||||
const $q = useQuasar();
|
||||
const fullwidthBtn = computed(() => $q.screen.width <= $q.screen.sizes.md);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-form @submit.prevent="saveForm" ref="form">
|
||||
<slot name="default"/>
|
||||
|
||||
<div class="text-right">
|
||||
<q-btn
|
||||
color="primary"
|
||||
type="submit"
|
||||
size="lg"
|
||||
:class="{'q-my-lg': true, 'btn--fullwidth': fullwidthBtn}"
|
||||
v-if="saveButton"
|
||||
:icon="props.saveButton.icon"
|
||||
:loading="props.isRequestPending"
|
||||
>
|
||||
{{ props.saveButton.label }}
|
||||
|
||||
<template v-slot:loading>
|
||||
<q-spinner />
|
||||
</template>
|
||||
</q-btn>
|
||||
</div>
|
||||
<FormSubmitButton v-if="saveButton" :save-button="saveButton" />
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.btn--fullwidth {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user