Skip to content

Commit da5c6ba

Browse files
authored
Merge branch 'master' into master
2 parents 874f948 + e8e5eff commit da5c6ba

File tree

6 files changed

+580
-151
lines changed

6 files changed

+580
-151
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> A native Vue.js select component that provides similar functionality to Select2 without the overhead of jQuery.
44
5+
Want to help out as a primary contributor? [Get in touch](https://github.com/sagalbot/vue-select/issues/581)!
6+
57
#### Features
68
- AJAX Support
79
- Tagging
@@ -104,3 +106,7 @@ When provided an array of objects, `vue-select` will display a single value of t
104106
```
105107

106108
### For more information, please visit the [vue-select documentation.](https://sagalbot.github.io/vue-select)
109+
110+
## License
111+
112+
[MIT](https://github.com/sagalbot/vue-select/blob/master/LICENSE.md)

dev/dev.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<!--<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">-->
1010
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css">-->
1111
<style>
12-
12+
1313
#app {
1414
height: 95vh;
1515
display: flex;
@@ -67,7 +67,7 @@
6767
</button>
6868
</span>
6969
</v-select>
70-
70+
<v-select placeholder="select on tab" :select-on-tab="true" :options="options"></v-select>
7171
<v-select placeholder="disabled" disabled value="disabled"></v-select>
7272
<v-select placeholder="disabled multiple" disabled multiple :value="['disabled', 'multiple']"></v-select>
7373
<v-select placeholder="filterable=false, @search=searchPeople" label="first_name" :filterable="false" @search="searchPeople" :options="people"></v-select>

docs/gitbook/Basics/Options.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,27 @@ If you wanted to display `Canada` in the dropdown, you'd use the `countryName` k
3333

3434
[](codepen://sagalbot/aEjLPB?height=500)
3535

36+
37+
### Option index {#values}
38+
39+
When the `options` array contains objects, `vue-select` returns the whole object as dropdown value upon selection. You can specify your own `index` prop to return only the value contained in the specific property.
40+
41+
For example, consider an object with `value` and `label` properties:
42+
43+
```json
44+
{
45+
value: "CA",
46+
label: "Canada"
47+
}
48+
```
49+
50+
If you wanted to return `CA` in the dropdown when `Canada` is selected, you'd use the `index` key:
51+
52+
```html
53+
<v-select index="value" :options="countries"></v-select>
54+
```
55+
56+
3657
### Null / Empty Options {#null}
3758

3859
`vue-select` requires the `option` property to be an `array`. If you are using Vue in development mode, you will get warnings attempting to pass anything other than an `array` to the `options` prop. If you need a `null`/`empty` value, use an empty array `[]`.

docs/gitbook/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222

2323
#### Resources
2424
- **[CodePen Template](http://codepen.io/sagalbot/pen/NpwrQO)**
25-
- **[Trello Roadmap](https://trello.com/b/vWvITNzS/vue-select)**
25+
- **[Trello Roadmap](https://trello.com/b/vWvITNzS/vue-select)**
26+
- **[GitHub](https://github.com/sagalbot/vue-select)**

0 commit comments

Comments
 (0)