add default field options

This commit is contained in:
Pete Matsyburka
2025-01-16 00:40:22 +02:00
parent f210f1d8bf
commit 9bd0ad70c4
2 changed files with 9 additions and 5 deletions
+5 -1
View File
@@ -1320,7 +1320,11 @@ export default {
if (!this.fieldsDragFieldRef.value) {
if (['select', 'multiple', 'radio'].includes(field.type)) {
field.options = [{ value: '', uuid: v4() }]
if (this.dragField?.options?.length) {
field.options = this.dragField.options.map(option => ({ value: option, uuid: v4() }))
} else {
field.options = [{ value: '', uuid: v4() }]
}
}
if (['stamp', 'heading'].includes(field.type)) {