Update Form mixin so that you can enable the save button for a form on render

This commit is contained in:
leigh-mil
2019-10-31 13:15:51 -04:00
parent f3dcca8368
commit d142fa974a
4 changed files with 14 additions and 10 deletions

View File

@@ -5,6 +5,10 @@ export default {
type: Boolean,
default: false,
},
enableSave: {
type: Boolean,
default: false,
},
},
mounted: function() {
@@ -52,9 +56,9 @@ export default {
canSave: function() {
const formValid = !this.invalid
if (formValid) {
if (this.changed && formValid) {
return true
} else if (this.changed && formValid) {
} else if (this.enableSave && formValid) {
return true
} else {
return false