Created
March 28, 2018 19:31
-
-
Save BHEADRICK/99bf5bc72775522449ed9a8d2dd01356 to your computer and use it in GitHub Desktop.
BsSelect
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> | |
<div v-bind:class="'form-group ' + wrapperClass"> | |
<span class="required-lbl" v-if="required">* </span> | |
<label>{{ label }}</label> | |
<select class="form-control" v-bind:required="required" @change="updateInput($event.target.value)"> | |
<option v-if="placeholder" value="">{{placeholder}}</option> | |
<option v-for="(option,key) in this.options" value="option" v-bind:value="key">{{option}}</option> | |
</select> | |
</div> | |
</template> | |
<script> | |
module.exports = { | |
data () { | |
return {} | |
}, | |
props: { | |
value: String, | |
name: String, | |
label: String, | |
placeholder: String, | |
model: String, | |
required: String, | |
options: null, | |
wrapperClass: {type: String, default: 'col-md-12'} | |
}, | |
methods: { | |
updateInput (val) { | |
this.$emit('input', val) | |
} | |
} | |
} | |
</script> | |
<style> | |
</style> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment