Skip to content

Instantly share code, notes, and snippets.

@BHEADRICK
Created March 28, 2018 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BHEADRICK/99bf5bc72775522449ed9a8d2dd01356 to your computer and use it in GitHub Desktop.
Save BHEADRICK/99bf5bc72775522449ed9a8d2dd01356 to your computer and use it in GitHub Desktop.
BsSelect
<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