update components to emit valid on field-change and use in TO form

This commit is contained in:
leigh-mil
2019-06-15 13:24:17 -04:00
parent 414e5989f5
commit 56bc9dd4e5
8 changed files with 75 additions and 20 deletions

View File

@@ -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) {