Created
February 11, 2020 08:40
-
-
Save RHMason/c9ea6cd07e76f99e299b2968861f9de7 to your computer and use it in GitHub Desktop.
Form using Nuxt
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> | |
<section class="container"> | |
<div> | |
</div> | |
<!-- Begin page content --> | |
<main role="main" class="flex-shrink-0"> | |
<div class="container"> | |
<form> | |
<div class="form-group"> | |
<label for="Name">Name</label> | |
<input type="text" class="form-control" v-model="title" name="Name" id="Name" size="30" placeholder="Enter Name"> | |
</div> | |
<div class="form-group"> | |
<label for="Company">Company</label> | |
<input type="text" class="form-control" v-model="title2" name="Company" id="Company" size="30" placeholder="Enter Company"> | |
</div> | |
<div class="form-group"> | |
<label for="Email">Email</label> | |
<input type="text" class="form-control" v-model="title3" name="Email" id="Email" size="30" placeholder="Enter Email"> | |
</div> | |
<button type="submit" class="btn btn-primary" @click.stop.prevent="submit()">Submit</button> | |
</form> | |
</div> | |
</main> | |
</section> | |
</template> | |
<style> | |
.container | |
{ | |
min-height: 100vh; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
text-align: center; | |
} | |
.title | |
{ | |
font-family: "Quicksand", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* 1 */ | |
display: block; | |
font-weight: 300; | |
font-size: 100px; | |
color: #35495e; | |
letter-spacing: 1px; | |
} | |
.subtitle | |
{ | |
font-weight: 300; | |
font-size: 42px; | |
color: #526488; | |
word-spacing: 5px; | |
padding-bottom: 15px; | |
} | |
.links | |
{ | |
padding-top: 15px; | |
} | |
</style> | |
<script type="Javascript"> | |
import axios from 'axios' | |
export default { | |
data() { | |
return { | |
title: '', | |
title2: '', | |
title3: '', | |
errors: [] | |
} | |
}, | |
methods: { | |
submit() { | |
// console(title); | |
axios.post('http://localhost:8888/webapps/root/resources/index.cfm?endpoint=nuxtCreate', this.title, this.title2,this.title3) | |
.then((Response) => {}) | |
.catch((err) => { | |
this.errors.push(err) | |
}) | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment