2020-08-03 15:07:08 +02:00
|
|
|
<template>
|
|
|
|
<b-card :header="header" header-tag="h2" class="basic-form">
|
|
|
|
<b-form :id="id" @submit="$emit('submit', $event)">
|
|
|
|
<slot />
|
|
|
|
</b-form>
|
|
|
|
|
2020-09-13 17:35:32 +02:00
|
|
|
<template v-if="!noFooter" v-slot:footer>
|
2020-08-03 15:07:08 +02:00
|
|
|
<slot name="buttons">
|
|
|
|
<b-button type="submit" :form="id" variant="success">
|
|
|
|
{{ submit ? submit : $t('save') }}
|
|
|
|
</b-button>
|
|
|
|
</slot>
|
|
|
|
</template>
|
|
|
|
</b-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'BasicForm',
|
|
|
|
|
|
|
|
props: {
|
|
|
|
header: { type: String, required: true },
|
|
|
|
id: { type: String, default: 'ynh-form' },
|
2020-09-13 17:35:32 +02:00
|
|
|
submit: { type: String, default: null },
|
|
|
|
noFooter: { type: Boolean, default: false }
|
2020-08-03 15:07:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.basic-form .card-footer {
|
|
|
|
display: flex;
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
& > *:not(:first-child) {
|
|
|
|
margin-left: .5rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|