Fix logic actions options (#136)
This commit is contained in:
parent
e47dea7936
commit
a1e2f7b21d
|
@ -154,12 +154,9 @@ export default {
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
},
|
},
|
||||||
'field.required': {
|
'field.required': 'cleanConditions',
|
||||||
handler() {
|
'field.disabled': 'cleanConditions',
|
||||||
this.cleanConditions()
|
'field.hidden': 'cleanConditions',
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -185,12 +182,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cleanConditions() {
|
cleanConditions() {
|
||||||
if (this.required && this.logic.actions.includes('require-answer')) {
|
const availableActions = this.actionOptions.map(function(op){ return op.value });
|
||||||
this.$set(this.logic, 'actions', this.logic.actions.filter((action) => action !== 'require-answer'))
|
this.$set(this.logic, 'actions', availableActions.filter(value => this.logic.actions.includes(value)))
|
||||||
} else if (!this.required && this.logic.actions.includes('make-it-optional')) {
|
this.refreshActions()
|
||||||
this.$set(this.logic, 'actions', this.logic.actions.filter((action) => action !== 'make-it-optional'))
|
|
||||||
}
|
|
||||||
this.resetKey++
|
|
||||||
},
|
},
|
||||||
refreshActions() {
|
refreshActions() {
|
||||||
this.resetKey++
|
this.resetKey++
|
||||||
|
|
Loading…
Reference in New Issue