mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
update AbstractForm to be more generic
This commit is contained in:
parent
dc0868262e
commit
c178347990
1 changed files with 13 additions and 17 deletions
|
@ -1,40 +1,37 @@
|
||||||
<template>
|
<template>
|
||||||
<b-tab no-body>
|
<div>
|
||||||
<template #title>
|
|
||||||
<icon :iname="icon" /> {{ name }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<b-card-body>
|
<b-card-body>
|
||||||
<slot name="disclaimer" />
|
<slot name="disclaimer" />
|
||||||
|
|
||||||
|
|
||||||
<b-form
|
<b-form
|
||||||
:id="id" :inline="inline" :class="formClasses"
|
:id="id" :inline="inline" :class="formClasses"
|
||||||
@submit.prevent="onSubmit" novalidate
|
@submit.prevent="onSubmit" novalidate
|
||||||
>
|
>
|
||||||
<slot name="default" />
|
<slot name="default" />
|
||||||
|
|
||||||
<slot name="server-error">
|
<slot name="server-error" v-bind="{ errorFeedback }">
|
||||||
<b-alert
|
<b-alert
|
||||||
|
v-if="errorFeedback"
|
||||||
variant="danger" class="my-3" icon="ban"
|
variant="danger" class="my-3" icon="ban"
|
||||||
:show="errorFeedback !== ''" v-html="errorFeedback"
|
v-html="errorFeedback"
|
||||||
/>
|
/>
|
||||||
</slot>
|
</slot>
|
||||||
</b-form>
|
</b-form>
|
||||||
</b-card-body>
|
</b-card-body>
|
||||||
|
|
||||||
<b-card-footer>
|
<b-card-footer v-if="!noFooter">
|
||||||
<b-button type="submit" variant="success" :form="id">
|
<slot name="footer">
|
||||||
{{ submitText ? submitText : $t('save') }}
|
<b-button type="submit" variant="success" :form="id">
|
||||||
</b-button>
|
{{ submitText || $t('save') }}
|
||||||
|
</b-button>
|
||||||
|
</slot>
|
||||||
</b-card-footer>
|
</b-card-footer>
|
||||||
</b-tab>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TabForm',
|
name: 'AbstractForm',
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
id: { type: String, default: 'ynh-form' },
|
id: { type: String, default: 'ynh-form' },
|
||||||
|
@ -43,8 +40,7 @@ export default {
|
||||||
serverError: { type: String, default: '' },
|
serverError: { type: String, default: '' },
|
||||||
inline: { type: Boolean, default: false },
|
inline: { type: Boolean, default: false },
|
||||||
formClasses: { type: [Array, String, Object], default: null },
|
formClasses: { type: [Array, String, Object], default: null },
|
||||||
name: { type: String, required: true },
|
noFooter: { type: Boolean, default: false }
|
||||||
icon: { type: String, default: 'wrench' }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue