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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user