2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

docs(readme): updated instruction for vue 3 (#1629)

This commit is contained in:
Zi Y
2022-12-17 15:24:32 -05:00
committed by GitHub
parent ffd544f101
commit 6de1375690
+29 -2
View File
@@ -34,12 +34,14 @@ with GitHub sponsors!
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!
## Install
## Get started
**Vue 3 / Vue Select 4.x-beta**
> 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!
Install:
**Vue 3 / Vue Select 4.x-beta**
```bash
yarn add vue-select@beta
@@ -48,7 +50,32 @@ yarn add vue-select@beta
npm install vue-select@beta
```
Then, import and register the component:
```js
# main.ts or main.js
import { createApp } from "vue";
import App from "./App.vue";
import { VueSelect } from "vue-select";
createApp(App)
.component("v-select", VueSelect)
.mount("#app");
```
The component itself does not include any CSS. You'll need to include it separately in your Component.vue:
```vue
<style>
@import "vue-select/dist/vue-select.css";
</style>
```
**Vue 2 / Vue Select 3.x**
Install:
```bash
yarn add vue-select