add default draw field prop

This commit is contained in:
Pete Matsyburka committed 2024-02-21 02:04:44 +02:00
1 parent 4eb4e8c1f8
commit 7b2cadcb91
2 files changed
+13 -3

No files matched your search

+4 -2
View File
@@ -61,7 +61,7 @@ export default {
components: {
FieldArea
},
inject: ['fieldTypes'],
inject: ['fieldTypes', 'defaultDrawFieldType'],
props: {
image: {
type: Object,
@@ -123,7 +123,9 @@ export default {
},
computed: {
defaultFieldType () {
if (this.fieldTypes.length !== 0 && !this.fieldTypes.includes('text')) {
if (this.defaultDrawFieldType && this.defaultDrawFieldType !== 'text') {
return this.defaultDrawFieldType
} else if (this.fieldTypes.length !== 0 && !this.fieldTypes.includes('text')) {
return this.fieldTypes[0]
} else {
return 'text'