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)
|
this.$store.commit('open/working_form/openSettingsForField', this.formFields.length-1)
|
||||||
},
|
},
|
||||||
removeBlock(blockIndex) {
|
removeBlock(blockIndex) {
|
||||||
this.closeSidebar()
|
|
||||||
const newFields = clonedeep(this.formFields)
|
const newFields = clonedeep(this.formFields)
|
||||||
newFields.splice(blockIndex, 1)
|
newFields.splice(blockIndex, 1)
|
||||||
this.$set(this, 'formFields', newFields)
|
this.$set(this, 'formFields', newFields)
|
||||||
|
this.closeSidebar()
|
||||||
},
|
},
|
||||||
closeSidebar() {
|
closeSidebar() {
|
||||||
this.$store.commit('open/working_form/closeEditFieldSidebar')
|
this.$store.commit('open/working_form/closeEditFieldSidebar')
|
||||||
|
|
|
@ -121,18 +121,18 @@ export default {
|
||||||
this.$set(this.field, 'type', newType)
|
this.$set(this.field, 'type', newType)
|
||||||
},
|
},
|
||||||
removeBlock() {
|
removeBlock() {
|
||||||
this.closeSidebar()
|
|
||||||
const newFields = clonedeep(this.form.properties)
|
const newFields = clonedeep(this.form.properties)
|
||||||
newFields.splice(this.selectedFieldIndex, 1)
|
newFields.splice(this.selectedFieldIndex, 1)
|
||||||
this.$set(this.form, 'properties', newFields)
|
this.$set(this.form, 'properties', newFields)
|
||||||
|
this.closeSidebar()
|
||||||
},
|
},
|
||||||
duplicateBlock() {
|
duplicateBlock() {
|
||||||
this.closeSidebar()
|
|
||||||
const newFields = clonedeep(this.form.properties)
|
const newFields = clonedeep(this.form.properties)
|
||||||
const newField = clonedeep(this.form.properties[this.selectedFieldIndex])
|
const newField = clonedeep(this.form.properties[this.selectedFieldIndex])
|
||||||
newField.id = this.generateUUID()
|
newField.id = this.generateUUID()
|
||||||
newFields.push(newField)
|
newFields.push(newField)
|
||||||
this.$set(this.form, 'properties', newFields)
|
this.$set(this.form, 'properties', newFields)
|
||||||
|
this.closeSidebar()
|
||||||
},
|
},
|
||||||
closeSidebar() {
|
closeSidebar() {
|
||||||
this.$store.commit('open/working_form/closeEditFieldSidebar')
|
this.$store.commit('open/working_form/closeEditFieldSidebar')
|
||||||
|
|
Loading…
Reference in New Issue