mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
d262f6b48a
- add vue 2.x as a peer dependency - update readme for v2.0
2.2 KiB
2.2 KiB
vue-select

A native Vue.js select component that provides similar functionality to Select2 without the overhead of jQuery.
Features
- AJAX Support
- Tagging
- No JS Dependenciesp
- List Filtering/Searching
- Supports Vuex
- Select Single/Multiple Options
- Bootstrap Friendly Markup
- +95% Test Coverage
Documentation
Install / Usage
Vue Compatability
Version 2.x of vue-select is compatible with Vue 2.x. If you are on Vue 1.x, you will need to use 1.x of vue-select.
NPM
$ npm install vue-select
<template>
<div>
<v-select v-model="select" :options="options"></v-select>
</div>
</template>
<script>
import vSelect from 'vue-select'
export default {
components: {vSelect},
data() {
return {
selected: null,
options: ['foo','bar','baz']
}
}
}
</script>
Browser Globals v1.3.0+
Just include vue & vue-select.js - I recommend using unpkg.
<!-- use the latest release -->
<script src="https://unpkg.com/vue-select@latest"></script>
<!-- or point to a specific release -->
<script src="https://unpkg.com/vue-select@1.3.3"></script>
Then register the component in your javascript:
Vue.component('v-select', VueSelect.VueSelect);
From there you can use as normal. Here's an example on JSBin.
**For more information, please visit the documentation