1.0.5 • Published 5 years ago

vue-simple-selectbox v1.0.5

Weekly downloads
8
License
MIT
Repository
-
Last release
5 years ago

Vue simple selectbox

License License License License License

Vue simple selectbox allows you to easy work and change the wrapper on top of the default select element.

Install

Install the dependency with

yarn add vue-simple-selectbox

or for npm

npm install --save vue-simple-selectbox

In the Vue you can use it by simply importing it

import SelectBox from "vue-simple-selectbox";

export default {
  components: { SelectBox },
  data: function() {
    return {
      options: [
        {value:"blue", text:"It's Blue"},
        {value:"yellow", text:"Well no, it's Yellow"},
        {value:"green", text:"Nice and cool Green"}
      ]
    }
  }
}

And use it like any other component

<template>
  <div id="app">
    <SelectBox :placeholder="'Default placeholder...'" :options="options" :selected="'green'" :minWidth="190"></SelectBox>
  </div>
</template>

Props

OptionTypeRequiredDefaultInfo
placeholderstringfalse'Select item...'Default placeholder
selectedstringfalse-Value of the selected element if none is selected(if not set, then placeholder is displayed)
minWidthnumberfalse160Min-width css property applied to the select container
optionsarraytrue-Array of objects {value: 'value', text: 'text'} to be shown in the select box

Getting the value

Selectbox emits event selectOption. So one can call a method on change

<SelectBox :options="options" v-on:selectOption="changeOption"></SelectBox>
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago