Fix remove block (#195)
This commit is contained in:
parent
7119ec2304
commit
f82a8afe79
|
@ -294,10 +294,10 @@ export default {
|
|||
this.$store.commit('open/working_form/openSettingsForField', this.formFields.length-1)
|
||||
},
|
||||
removeBlock(blockIndex) {
|
||||
this.closeSidebar()
|
||||
const newFields = clonedeep(this.formFields)
|
||||
newFields.splice(blockIndex, 1)
|
||||
this.$set(this, 'formFields', newFields)
|
||||
this.closeSidebar()
|
||||
},
|
||||
closeSidebar() {
|
||||
this.$store.commit('open/working_form/closeEditFieldSidebar')
|
||||
|
|
|
@ -121,18 +121,18 @@ export default {
|
|||
this.$set(this.field, 'type', newType)
|
||||
},
|
||||
removeBlock() {
|
||||
this.closeSidebar()
|
||||
const newFields = clonedeep(this.form.properties)
|
||||
newFields.splice(this.selectedFieldIndex, 1)
|
||||
this.$set(this.form, 'properties', newFields)
|
||||
this.closeSidebar()
|
||||
},
|
||||
duplicateBlock() {
|
||||
this.closeSidebar()
|
||||
const newFields = clonedeep(this.form.properties)
|
||||
const newField = clonedeep(this.form.properties[this.selectedFieldIndex])
|
||||
newField.id = this.generateUUID()
|
||||
newFields.push(newField)
|
||||
this.$set(this.form, 'properties', newFields)
|
||||
this.closeSidebar()
|
||||
},
|
||||
closeSidebar() {
|
||||
this.$store.commit('open/working_form/closeEditFieldSidebar')
|
||||
|
|
Loading…
Reference in New Issue