-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fefbf4a
commit c33c6fe
Showing
8 changed files
with
186 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<div> | ||
<h3>UIV Type Ahead</h3> | ||
<label for="input-2">States of America:</label> | ||
<input id="input-2" class="form-control" type="text" placeholder="Type to search..."> | ||
<typeahead v-model="model" target="#input-2" match-start :data="states" item-key="name"/> | ||
<br/> | ||
<alert v-show="model">You selected {{model}}</alert> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
model: '', | ||
states: [ | ||
{"name": "Minnesota", "abbreviation": "MN" }, | ||
{"name": "New York", "abbreviation": "NY"}, | ||
{"name": "South Carolina", "abbreviation": "SC"} | ||
], | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.dropdown-menu { | ||
display: block; | ||
} | ||
li { | ||
display: block; | ||
margin: 0 10px; | ||
a:hover { | ||
color: #fff; | ||
text-decoration: none; | ||
outline: 0; | ||
background-color: #337ab7; | ||
} | ||
} | ||
</style> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<template> | ||
<form @submit.prevent="validateBeforeSubmit"> | ||
<div class="column is-12"> | ||
<label class="label">Email</label> | ||
<p class="control has-icon has-icon-right"> | ||
<input name="email" v-model="email" v-validate="'required|email'" :class="{'input': true, 'is-danger': errors.has('email') }" type="text" placeholder="Email"> | ||
<i v-show="errors.has('email')" class="fa fa-warning"></i> | ||
<span v-show="errors.has('email')" class="help is-danger">{{ errors.first('email') }}</span> | ||
</p> | ||
</div> | ||
<div class="column is-12"> | ||
<label class="label">Name</label> | ||
<p class="control has-icon has-icon-right"> | ||
<input name="name" v-model="name" v-validate="'required|alpha'" :class="{'input': true, 'is-danger': errors.has('name') }" type="text" placeholder="Name"> | ||
<i v-show="errors.has('name')" class="fa fa-warning"></i> | ||
<span v-show="errors.has('name')" class="help is-danger">{{ errors.first('name') }}</span> | ||
</p> | ||
</div> | ||
<div class="column is-12"> | ||
<label class="label">Phone</label> | ||
<p class="control has-icon has-icon-right"> | ||
<input name="phone" v-model="phone" v-validate="'required|numeric'" :class="{'input': true, 'is-danger': errors.has('phone') }" type="text" placeholder="Phone"> | ||
<i v-show="errors.has('phone')" class="fa fa-warning"></i> | ||
<span v-show="errors.has('phone')" class="help is-danger">{{ errors.first('phone') }}</span> | ||
</p> | ||
</div> | ||
<div class="column is-12"> | ||
<label class="label">Website</label> | ||
<p class="control has-icon has-icon-right"> | ||
<input name="url" v-model="url" v-validate="'required|url'" :class="{'input': true, 'is-danger': errors.has('url') }" type="text" placeholder="Website"> | ||
<i v-show="errors.has('url')" class="fa fa-warning"></i> | ||
<span v-show="errors.has('url')" class="help is-danger">{{ errors.first('url') }}</span> | ||
</p> | ||
</div> | ||
|
||
<div class="column is-12"> | ||
<p class="control"> | ||
<button class="button is-primary" type="submit">Submit</button> | ||
</p> | ||
</div> | ||
</form> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'form-example', | ||
data: () => ({ | ||
email: '', | ||
name: '', | ||
phone: '', | ||
url: '' | ||
}), | ||
methods: { | ||
validateBeforeSubmit() { | ||
this.$validator.validateAll().then((result) => { | ||
if (result) { | ||
// eslint-disable-next-line | ||
alert('Form Submitted!'); | ||
return; | ||
} | ||
alert('Correct them errors!'); | ||
}); | ||
} | ||
} | ||
}; | ||
</script> |
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