0.4.5 • Published 12 months ago

@ian-regcheq/vue-bootstrap-select v0.4.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

AUR version npm bundle size (minified)

@alfsnd/vue-bootstrap-select

A vue version of bootstrap select

Demo

Edit Vue Bootstrap Select Demo

Install

npm install @alfsnd/vue-bootstrap-select --save

Usage

import VSelect from '@alfsnd/vue-bootstrap-select'

export default {
  name: 'app',
  components: {
    VSelect
  },
  data() {
    return {
      selectedValue: null
    };
  }
}
<template>
  <div id="app">
    <v-select :options="[{value: 1, text: 'Item 1'}, {value: 2, text: 'Item 2'}]" v-model="selectedValue" />
  </div>
</template>

Passing options

The options prop accepts arrays of strings

  <v-select :options="['Item 1', 'Item 2']" />

And arrays of objects

<v-select :options="[{value: 1, text: 'Item 1'}, {value: 2, text: 'Item 2'}]" />

Props

parameterdescriptiontypedefaultacceptable value
disableddisables selectBooleanfalse
disabledPropallows to disable specific options. If an option has this prop set to a truthy value it will disable the option.Stringdisabled
labelNotFoundtext displayed when no option is found in the search resultsStringNo results matched
labelSearchPlaceholderplaceholder text for search inputStringSearch
optionslist of optionsArray[]
searchabledisplay search inputBooleanfalse
showDefaultOptionsets the select title is set as an optionBooleanfalse
textPropthe option's prop that is displayed as the option's textStringtext
valuePropthe option's prop that is used to find the selected valueStringvalue
filterFunctiona function that can be used to do own filteringFunction (options, searchValue) => filteredOptionslowercase string comparison
0.4.5

12 months ago

0.4.4

12 months ago