Last active
June 30, 2020 04:30
-
-
Save ann-kilzer/8ba20064a4902e33d055551f40bc6ee1 to your computer and use it in GitHub Desktop.
Vuetify Form before Netlify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<v-form @submit.prevent="handleSubmit"> | |
<two-button-modal | |
title="Send a message" | |
@cancel="$emit('cancel')" | |
> | |
<v-text-field | |
v-model="form.name" | |
label="Your Name" | |
/> | |
<v-text-field | |
v-model="form.email" | |
label="Email" | |
/> | |
<v-textarea | |
v-model="form.message" | |
label="Message" | |
/> | |
</two-button-modal> | |
</v-form> | |
</template> | |
<script> | |
import TwoButtonModal from './TwoButtonModal.vue'; | |
export default { | |
components: { | |
TwoButtonModal, | |
}, | |
data: () => ({ | |
form: { | |
name: '', | |
email: '', | |
message: '', | |
}, | |
}), | |
methods: { | |
resetForm() { | |
this.$set(this.form, 'name', ''); | |
this.$set(this.form, 'email', ''); | |
this.$set(this.form, 'message', ''); | |
}, | |
handleSubmit() { | |
// TODO: How to send this to Netlify? | |
this.resetForm(); | |
}, | |
}, | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment