Added name prop and fixed grid stacking
This commit is contained in:
parent
8613326822
commit
cf1e766464
1 changed files with 30 additions and 22 deletions
|
|
@ -1,33 +1,36 @@
|
||||||
<template>
|
<template>
|
||||||
<form @submit.prevent="submitForm" class="uk-form-stacked">
|
<div>
|
||||||
|
<form @submit.prevent="submitForm" class="uk-form-stacked">
|
||||||
|
|
||||||
<button type="button" v-on:click="getFormData()" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">{{ "Update values" }}</button>
|
<button type="button" v-if="selfUpdate" v-on:click="getFormData()" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">{{ "Update values" }}</button>
|
||||||
|
|
||||||
<div v-for="(field, index) in schema" :key="index">
|
<div v-for="(field, index) in schema" :key="index">
|
||||||
<div v-if="Array.isArray(field)" class="uk-grid-small" uk-grid>
|
<div v-if="Array.isArray(field)" class="uk-grid-small uk-width-1-1 uk-child-width-expand" uk-grid>
|
||||||
<div v-for="(subfield, subindex) in field" :key="subindex" class="uk-width-expand">
|
<div v-for="(subfield, subindex) in field" :key="subindex">
|
||||||
<component
|
<component
|
||||||
:is="subfield.fieldType"
|
:is="subfield.fieldType"
|
||||||
v-model="formData[subfield.name]"
|
v-model="formData[subfield.name]"
|
||||||
v-bind="subfield">
|
v-bind="subfield">
|
||||||
</component>
|
</component>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<component
|
||||||
|
:is="field.fieldType"
|
||||||
|
v-model="formData[field.name]"
|
||||||
|
v-bind="field">
|
||||||
|
</component>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<component
|
|
||||||
:is="field.fieldType"
|
|
||||||
v-model="formData[field.name]"
|
|
||||||
v-bind="field">
|
|
||||||
</component>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="uk-text-center uk-container" v-if="taskRunning">
|
<div class="uk-text-center uk-container" v-if="taskRunning">
|
||||||
<div class="center-spinner" uk-spinner></div>
|
<div class="center-spinner" uk-spinner></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button v-bind:hidden="taskRunning" type="submit" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">{{ submitLabel }}</button>
|
<button v-bind:hidden="taskRunning" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">{{ submitLabel }}</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -53,6 +56,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
'name': {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: "Plugin"
|
||||||
|
},
|
||||||
'schema': {
|
'schema': {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue