mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
ebcdcc5c621e55e37e51ca357b605d77e6439553
* make sure selected tracked value is an option if possible Before this case did not work correctly: - Select was rendered with *no* options, but *with* a saved value - Options were fetched by ajax and options prop was updated - Reduce function if passed What happens without this commit is that the selected tracked value simply was the raw reduced value (previously saved). Which means that displaying a label for example does not work if the label comes from the unreduced option. This commit makes sure that the internal tracked value is checked against all options not only once the select is created but additionally when options change. * remove useless keys - first key was always undefined - second key was always the index which is not usefull at all since it changes based on the order * add test for setting value after option changed * correctly react to value property changes if tracking internally fixes sagalbot#855, sagalbot#842 * add getOptionKey prop * yarn upgrade doc * add getOptionKey api doc and fix links * yarn upgrade * do not use key on slot * fix label spec
Make sure selected value is an option after option changed and react to value property changes even if tracking value internally (#914)
Make sure selected value is an option after option changed and react to value property changes even if tracking value internally (#914)
vue-select

Everything you wish the HTML
<select>element could do, wrapped up into a lightweight, zero dependency, extensible Vue component.
- Tagging
- Filtering / Searching
- Vuex Support
- AJAX Support
- SSR Support
- ~20kb Total / ~5kb CSS / ~15kb JS
- Select Single/Multiple Options
- Customizable with slots and SCSS variables
- Tested with Bootstrap 3/4, Bulma, Foundation
- +95% Test Coverage
- Zero dependencies
Documentation
Complete documentation and examples available at https://vue-select.org.
Install
$ npm install vue-select
Register the component
import Vue from 'vue'
import vSelect from 'vue-select'
Vue.component('v-select', vSelect)
You may now use the component in your markup
<v-select v-model="selected" :options="['Vue.js','React']"></v-select>
You can also include vue-select directly in the browser. Check out the documentation for loading from CDN..
License
Description
Languages
JavaScript
58%
Vue
26.4%
CSS
7.8%
SCSS
7.3%
HTML
0.5%