add default draw field prop

This commit is contained in:
Pete Matsyburka
2024-02-20 22:15:21 +02:00
parent 4eb4e8c1f8
commit 7b2cadcb91
2 changed files with 13 additions and 3 deletions
+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'