SHARE
TWEET

Untitled

a guest Dec 16th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top