update components to emit valid on field-change and use in TO form
This commit is contained in:
@@ -17,6 +17,7 @@ export default {
|
||||
},
|
||||
|
||||
props: {
|
||||
name: String,
|
||||
initialData: {
|
||||
type: String,
|
||||
},
|
||||
@@ -27,6 +28,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
optional: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
data: function() {
|
||||
@@ -38,6 +43,14 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
created: function() {
|
||||
emitEvent('field-mount', this, {
|
||||
optional: this.optional,
|
||||
name: this.name,
|
||||
valid: this.hasAttachment,
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
addAttachment: function(e) {
|
||||
this.attachment = e.target.value
|
||||
@@ -48,6 +61,7 @@ export default {
|
||||
value: e.target.value,
|
||||
name: this.name,
|
||||
watch: this.watch,
|
||||
valid: this.hasAttachment,
|
||||
})
|
||||
},
|
||||
removeAttachment: function(e) {
|
||||
|
Reference in New Issue
Block a user