Skip to content

Commit

Permalink
updated instruction for vue 3
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzii0920 committed Apr 30, 2022
1 parent fc643db commit d8b210e
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,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

Expand All @@ -47,7 +49,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

Expand Down

0 comments on commit d8b210e

Please sign in to comment.