Skip to content

Commit 37ffabf

Browse files
committed
better install instructions in readme
1 parent 4056466 commit 37ffabf

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

README.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Select Single/Multiple Options
1111
- Bootstrap Friendly Markup
1212
- +95% Test Coverage
13+
- ~32kb minified
1314

1415
## Documentation
1516
- **[Demo & Docs](http://sagalbot.github.io/vue-select/)**
@@ -18,52 +19,54 @@
1819
## Install & Basic Usage
1920

2021
#### Vue Compatibility
21-
- `vue-select ~2.0` is compatible with `vue ~2.0`
22-
- `vue-select ~1.0` is compatible with `vue ~1.0`
22+
- `vue ~2.0` use `vue-select ~2.0`
23+
- `vue ~1.0` use `vue-select ~1.0`
2324

24-
#### NPM
25+
## NPM
26+
Install the package. _You should install `vue-select@1.3.3` for use with vue `~1.0`._
2527

2628
```bash
2729
$ npm install vue-select
2830
```
2931

30-
```html
31-
<template>
32-
<div>
33-
<v-select v-model="select" :options="options"></v-select>
34-
</div>
35-
</template>
32+
Register the component
3633

37-
<script>
34+
```js
35+
import Vue from 'vue'
3836
import vSelect from 'vue-select'
39-
export default {
40-
components: {vSelect},
41-
data() {
42-
return {
43-
selected: null,
44-
options: ['foo','bar','baz']
45-
}
46-
}
47-
}
48-
</script>
37+
Vue.component(vSelect)
38+
```
39+
40+
You may now use the component in your markup
41+
42+
```html
43+
<v-select v-model="selected" :options="['foo','bar']"></v-select>
4944
```
5045

51-
#### CDN/Browser Globals
46+
## CDN
5247

5348
Just include `vue` & `vue-select.js` - I recommend using [unpkg](https://unpkg.com/#/).
5449

5550
```html
51+
<script scr="https://unpkg.com/vue@latest"></script>
5652
<!-- use the latest release -->
5753
<script src="https://unpkg.com/vue-select@latest"></script>
5854
<!-- or point to a specific release -->
5955
<script src="https://unpkg.com/vue-select@1.3.3"></script>
6056
```
57+
6158
Then register the component in your javascript:
6259

6360
```js
6461
Vue.component('v-select', VueSelect.VueSelect);
6562
```
6663

67-
From there you can use as normal. Here's an [example on JSBin](http://jsbin.com/saxaru/5/edit?html,js,output).
64+
You may now use the component in your markup
65+
66+
```html
67+
<v-select v-model="selected" :options="['foo','bar']"></v-select>
68+
```
69+
70+
Here's an [example on JSBin](http://jsbin.com/saxaru/5/edit?html,js,output).
6871

6972
### For more information, please visit the [vue-select documentation.](https://sagalbot.github.io/vue-select)

0 commit comments

Comments
 (0)