Update module field kind after it's selected
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
<b-select
|
||||
v-model="value.kind"
|
||||
:disabled="disabled"
|
||||
@change="$emit('updateKind')"
|
||||
>
|
||||
<option
|
||||
v-for="({ kind, label }) in fieldKinds"
|
||||
|
||||
@@ -301,6 +301,7 @@
|
||||
:is-duplicate="!!duplicateFields[index]"
|
||||
@edit="handleFieldEdit(module.fields[index])"
|
||||
@delete="module.fields.splice(index, 1)"
|
||||
@updateKind="handleFieldKindUpdate(index)"
|
||||
/>
|
||||
</draggable>
|
||||
|
||||
@@ -708,6 +709,11 @@ export default {
|
||||
this.updateField = compose.ModuleFieldMaker({ ...field })
|
||||
},
|
||||
|
||||
handleFieldKindUpdate (index) {
|
||||
const field = this.module.fields[index]
|
||||
this.module.fields.splice(index, 1, compose.ModuleFieldMaker({ ...field }))
|
||||
},
|
||||
|
||||
handleFieldSave (field) {
|
||||
const i = this.module.fields.findIndex(f => f.name === field.name)
|
||||
if (i > -1) {
|
||||
|
||||
Reference in New Issue
Block a user