项目作者: Sandalf

项目描述 :
A vue version of bootstrap select
高级语言: Vue
项目地址: git://github.com/Sandalf/vue-bootstrap-select.git
创建时间: 2018-12-10T23:59:33Z
项目社区:https://github.com/Sandalf/vue-bootstrap-select

开源协议:

下载


AUR version
npm bundle size (minified)

@alfsnd/vue-bootstrap-select

A vue version of bootstrap select

Demo

Edit Vue Bootstrap Select Demo

Install

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

Usage

  1. import VSelect from '@alfsnd/vue-bootstrap-select'
  2. export default {
  3. name: 'app',
  4. components: {
  5. VSelect
  6. },
  7. data() {
  8. return {
  9. selectedValue: null
  10. };
  11. }
  12. }
  1. <template>
  2. <div id="app">
  3. <v-select :options="[{value: 1, text: 'Item 1'}, {value: 2, text: 'Item 2'}]" v-model="selectedValue" ></v-select>
  4. </div>
  5. </template>

Passing options

The options prop accepts arrays of strings

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

And arrays of objects

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

Props

parameter description type default acceptable value
disabled disables select Boolean false
disabledProp allows to disable specific options. If an option has this prop set to a truthy value it will disable the option. String disabled
labelNotFound text displayed when no option is found in the search results String No results matched
labelSearchPlaceholder placeholder text for search input String Search
options list of options Array []
searchable display search input Boolean false
showDefaultOption sets the select title is set as an option Boolean false
textProp the option’s prop that is displayed as the option’s text String text
valueProp the option’s prop that is used to find the selected value String value