Skip to content

Commit 5e0ad19

Browse files
authored
bump upgrade guide (sagalbot#833)
1 parent 12665a5 commit 5e0ad19

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

docs/guide/install.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ global variable. You'll need to load Vue.js, vue-select JS & vue-select CSS.
4343
<link rel="stylesheet" href="https://unpkg.com/vue-select@latest/dist/vue-select.css">
4444

4545
<!-- or point to a specific vue-select release -->
46-
<script src="https://unpkg.com/vue-select@2.6.0"></script>
47-
<link rel="stylesheet" href="https://unpkg.com/vue-select@2.6.0/dist/vue-select.css">
46+
<script src="https://unpkg.com/vue-select@3.0.0"></script>
47+
<link rel="stylesheet" href="https://unpkg.com/vue-select@3.0.0/dist/vue-select.css">
4848
```
4949
Then register the component in your javascript:
5050

@@ -56,5 +56,5 @@ Vue.component('v-select', VueSelect.VueSelect);
5656

5757
## Vue Compatibility
5858

59-
If you're on Vue `1.x`, use vue-select `1.x`. The `1.x` branch has not received updates
60-
since the 2.0 release.
59+
- If you're on Vue `1.x`, use vue-select `1.x`.
60+
- The `1.x` branch has not received updates since the 2.0 release.

docs/guide/upgrading.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1-
## Removed Function Callbacks
1+
## `index` prop replaced with `reduce`
22

3-
Three function callbacks have been removed in favor of using events.
3+
- v2.x provided the `index` `{String}` prop to return a single key from a selected object
4+
- v3.x removes the `index` prop, replacing it with the `reduce` `{Function}` prop.
5+
6+
Using a function instead of a string provides a whole lot more flexibility, allowing for things like
7+
deeply nested values, and really cleaned up the code internally.
8+
9+
```js
10+
const options = [{country: 'Canada', code: 'CA'},];
11+
```
12+
13+
```html
14+
<!-- v2: using index --->
15+
<v-select :options="options" label="country" index="code" />
16+
17+
<!-- v3: using reduce --->
18+
<v-select :options="options" label="country" :reduce="country => country.code" />
19+
```
20+
21+
View the full [documentation for `reduce`](values.md#returning-a-single-key-with-reduce).
22+
23+
## Events instead of Callbacks
24+
25+
Three function callbacks have been removed in favor of using events.
426

527
- `onChange`
628
- `onInput`

0 commit comments

Comments
 (0)