2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00

Merge commit 'b92428101f1c6d4aa1fe864a88eb7079c245e009'

# Conflicts:
#	test/unit/specs/Select.spec.js
This commit is contained in:
Jeff
2018-08-07 19:47:13 -07:00
3 changed files with 338 additions and 28 deletions
+21
View File
@@ -33,6 +33,27 @@ If you wanted to display `Canada` in the dropdown, you'd use the `countryName` k
[](codepen://sagalbot/aEjLPB?height=500)
### Option index {#values}
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.
For example, consider an object with `value` and `label` properties:
```json
{
value: "CA",
label: "Canada"
}
```
If you wanted to return `CA` in the dropdown when `Canada` is selected, you'd use the `index` key:
```html
<v-select index="value" :options="countries"></v-select>
```
### Null / Empty Options {#null}
`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 `[]`.