35 lines
575 B
JavaScript
35 lines
575 B
JavaScript
import savebutton from '../components/save_button'
|
|
|
|
export default {
|
|
mounted: function() {
|
|
this.$root.$on('field-change', this.handleFieldChange)
|
|
},
|
|
|
|
methods: {
|
|
handleFieldChange: function(event) {
|
|
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,
|
|
},
|
|
}
|