You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**[Example on JSBin](http://jsbin.com/saxaru/5/edit?html,js,output)**
18
18
19
-
## Install & Basic Usage
19
+
## Install
20
20
21
21
###### Vue Compatibility
22
22
-`vue ~2.0` use `vue-select ~2.0`
@@ -69,4 +69,35 @@ You may now use the component in your markup
69
69
70
70
Here's an [example on JSBin](http://jsbin.com/saxaru/5/edit?html,js,output).
71
71
72
+
## Basic Usage
73
+
74
+
#### Syncing a Selected Value
75
+
76
+
The most common use case for `vue-select` is to have the chosen value synced with a parent component. `vue-select` takes advantage of the `v-model` syntax to sync values with a parent.
77
+
78
+
```html
79
+
<v-selectv-model="selected"></v-select>
80
+
```
81
+
```js
82
+
newVue({
83
+
data: {
84
+
selected:null
85
+
}
86
+
})
87
+
```
88
+
89
+
#### Setting Options
90
+
91
+
`vue-select` accepts arrays of strings and objects to use as options through the `options` prop.
92
+
93
+
```html
94
+
<v-select:options="['foo','bar']"></v-select>
95
+
```
96
+
97
+
When provided an array of objects, `vue-select` will display a single value of the object. By default, `vue-select` will look for a key named 'label' on the object to use as display text.
0 commit comments