Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <form>
- ...
- <button
- class='submit-btn'
- :disabled="!isEnabled"
- type="submit"
- >
- Calculate!
- </button>
- </form>
- </template>
- <script>
- ...
- computed: {
- isEnabled: function() {
- return !!Object.values(this.inputs).every(Boolean);
- }
- },
- methods: {
- handleSubmit: function() {
- const { isInChurch, stateOfResidence } = this.inputs;
- const cleanedinputs = {
- ...this.inputs,
- yearValue: yearValue.value,
- isInChurch: isInChurch.value,
- stateOfResidence: stateOfResidence.value
- };
- this.$emit("submitted", cleanedinputs);
- }
- }
- </script>
Add Comment
Please, Sign In to add comment