2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00
This commit is contained in:
Jeff Sagal
2022-07-26 22:04:12 -07:00
parent 98c278b2bb
commit 6d59e6fd02
122 changed files with 6151 additions and 9892 deletions
+64
View File
@@ -0,0 +1,64 @@
<script setup>
import CodePen from '../vitepress/components/CodePen.vue'
</script>
## Yarn / NPM
Install with yarn or npm:
```bash
# vue 2
yarn add vue-select
# vue 3
yarn add vue-select@beta
# or, using NPM
npm install vue-select
```
Then, import and register the component:
```js
import Vue from 'vue'
import vSelect from 'vue-select'
Vue.component('v-select', vSelect)
```
The component itself does not include any CSS. You'll need to include it separately:
```js
import 'vue-select/dist/vue-select.css';
```
## In the Browser
vue-select ships as an UMD module that is accessible in the browser. When loaded
in the browser, you can access the component through the `VueSelect.VueSelect`
global variable. You'll need to load Vue.js, vue-select JS & vue-select CSS.
```html
<!-- include VueJS first -->
<script src="https://unpkg.com/vue@latest"></script>
<!-- use the latest vue-select release -->
<script src="https://unpkg.com/vue-select@latest"></script>
<link rel="stylesheet" href="https://unpkg.com/vue-select@latest/dist/vue-select.css">
<!-- or point to a specific vue-select release -->
<script src="https://unpkg.com/vue-select@3.0.0"></script>
<link rel="stylesheet" href="https://unpkg.com/vue-select@3.0.0/dist/vue-select.css">
```
Then register the component in your javascript:
```js
Vue.component('v-select', VueSelect.VueSelect);
```
<CodePen url="dJjzeP" />
## Vue Compatibility
- Vue `2.x`, use vue-select `3.x`.
- Vue `3.x`, use vue-select `3.x@beta`.