Last active
November 13, 2017 00:19
-
-
Save jacobarriola/89b19c9f934a737c7368754b60c8d66a to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
<form @submit.prevent="submitForm"> | |
<input type="email" name="email" v-model="email"> | |
<textarea name="message" cols="30" rows="5" v-model="message" required></textarea> | |
<input type="submit" value="Submit"> | |
</form> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
email: '', | |
message: '', | |
endpoint: 'https://formspree.io/[email protected]' | |
} | |
}, | |
methods: { | |
async submitForm () { | |
const data = { | |
email: this.email, | |
message: this.message | |
} | |
const response = await this.$axios.post(this.endpoint, data) | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment