2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00
Markus ebcdcc5c62 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 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
2019-09-13 12:18:04 -07:00
2019-03-23 14:24:18 -07:00
2019-05-01 08:36:02 -07:00
2019-04-27 15:40:24 -07:00
2016-07-04 13:00:35 -07:00
2018-09-05 08:07:21 -07:00
2016-03-10 14:44:48 -08:00
2019-02-18 22:01:39 -08:00
2019-04-14 16:48:16 -07:00

vue-select Current Release Bundle Size Monthly Downloads Code Coverage Maintainability Score MIT License

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

MIT

S
Description
No description provided
Readme 15 MiB
Languages
JavaScript 58%
Vue 26.4%
CSS 7.8%
SCSS 7.3%
HTML 0.5%