Add vue component for save button and integrate into FormMixin

This commit is contained in:
leigh-mil
2019-04-01 20:37:21 -04:00
parent 40a4e205d9
commit 3ece7b4c89
3 changed files with 40 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
import savebutton from '../components/save_button'
export default {
mounted: function() {
this.$root.$on('field-change', this.handleFieldChange)
@@ -8,7 +10,25 @@ export default {
const { value, name } = event
if (typeof this[name] !== undefined) {
this[name] = value
this.disabled = false
}
},
},
data: function() {
return {
disabled: this.disableSave,
}
},
props: {
disableSave: {
type: Boolean,
default: true,
},
},
components: {
savebutton,
},
}