Add canSave to the form mixin to toggle whether or not the Next button is disabled

This commit is contained in:
leigh-mil 2019-07-17 10:08:20 -04:00
parent c8e700c8fe
commit 72d274c1f8
2 changed files with 13 additions and 1 deletions

View File

@ -44,6 +44,18 @@ export default {
},
},
computed: {
canSave: function() {
if (!this.invalid) {
return true
} else if (this.changed && !this.invalid) {
return true
} else {
return false
}
},
},
data: function() {
return {
changed: this.hasChanges,

View File

@ -13,7 +13,7 @@
<input
type="submit"
tabindex="0"
:disabled="!changed"
:disabled="!canSave"
value="{{ next_button_text }}"
form="to_form"
class="usa-button usa-button-primary">