Guest User

Untitled

a guest
Dec 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <template>
  2. <form>
  3. ...
  4. <button
  5. class='submit-btn'
  6. :disabled="!isEnabled"
  7. type="submit"
  8. >
  9. Calculate!
  10. </button>
  11. </form>
  12. </template>
  13. <script>
  14. ...
  15. computed: {
  16. isEnabled: function() {
  17. return !!Object.values(this.inputs).every(Boolean);
  18. }
  19. },
  20. methods: {
  21. handleSubmit: function() {
  22. const { isInChurch, stateOfResidence } = this.inputs;
  23. const cleanedinputs = {
  24. ...this.inputs,
  25. yearValue: yearValue.value,
  26. isInChurch: isInChurch.value,
  27. stateOfResidence: stateOfResidence.value
  28. };
  29. this.$emit("submitted", cleanedinputs);
  30. }
  31. }
  32. </script>
Add Comment
Please, Sign In to add comment