From d8b210ee5d633f5972c9cec103a2bd0fb6cb2671 Mon Sep 17 00:00:00 2001 From: yangzii0920 <11530441+yangzii0920@users.noreply.github.com> Date: Fri, 29 Apr 2022 22:07:24 -0400 Subject: [PATCH] updated instruction for vue 3 --- README.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d76b7b8d..4466e4ada 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 + +``` + **Vue 2 / Vue Select 3.x** + +Install: + ```bash yarn add vue-select