Skip to content

Commit 6de1375

Browse files
authored
docs(readme): updated instruction for vue 3 (#1629)
1 parent ffd544f commit 6de1375

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ with GitHub sponsors!
3434

3535
Huge thanks to the [sponsors](https://github.com/sponsors/sagalbot) and [contributors](https://github.com/sagalbot/vue-select/graphs/contributors) that make Vue Select possible!
3636

37-
## Install
37+
## Get started
38+
39+
**Vue 3 / Vue Select 4.x-beta**
3840

3941
> Vue 3 support is on the `beta` channel: `vue-select@beta`, and will become the new default when `v4` is released. See [#1579](https://github.com/sagalbot/vue-select/issues/1597) for more details!
4042
43+
Install:
4144

42-
**Vue 3 / Vue Select 4.x-beta**
4345
```bash
4446
yarn add vue-select@beta
4547

@@ -48,7 +50,32 @@ yarn add vue-select@beta
4850
npm install vue-select@beta
4951
```
5052

53+
Then, import and register the component:
54+
55+
```js
56+
# main.ts or main.js
57+
58+
import { createApp } from "vue";
59+
import App from "./App.vue";
60+
61+
import { VueSelect } from "vue-select";
62+
63+
createApp(App)
64+
.component("v-select", VueSelect)
65+
.mount("#app");
66+
```
67+
68+
The component itself does not include any CSS. You'll need to include it separately in your Component.vue:
69+
```vue
70+
<style>
71+
@import "vue-select/dist/vue-select.css";
72+
</style>
73+
```
74+
5175
**Vue 2 / Vue Select 3.x**
76+
77+
Install:
78+
5279
```bash
5380
yarn add vue-select
5481

0 commit comments

Comments
 (0)