vue-select2-component

Select2 encapsulation for Vue 1.x
2,302 2
Install
npm install vue-select2-component
Latest Version:1.0.1
License:MIT
Last Updated:Apr 10, 2017
Links: GitHub  ·  npm
Maintainer: kenberkeley

Vue Select2 Component

npm version npm download

Intellectual property of Oneway.mobi

Requirement
  • Vue 1.x
  • jQuery ( available globally )
  • Select2
Installation

npm i vue-select2-component -S

alternatively: <script src="dist/vue-select2-component.min.js"></script>
which exposes VueSelect2 as a global variable

Example

See here, source in example.html

I prefer inspecting it with devtools

Configuration
  • @prop {String/String[]} model (.sync!), defaults to ''
  • @prop {String} models (.sync!), defaults to ''
  • @prop {Object[]} options (required!), must in [{ value: {String/Number}, text: {String} }] pattern
  • @prop {Object} config, defaults to {}. Besides the basic configuration of Select2, we have some extra settings:
    • multiple: defaults to undefined ( Meaning default as a single select )
    • width: defaults to 100%
    • delimiter: defaults to , ( Only for multiple select )
    • showValInText: defaults to undefined. If set to true, the render result would be:
    <select>
      <option>(1) Apple</option>
      <option>(2) Banana</option>
      ...
    </select>
Build

npm run build

Related Packages

v-select2-component

select2 component in vue.

258,554 121
v-select2-component-reloaded

select2 component in vue.

4,608 121
vue3-select2-component

select2 component in vue3.

157,198 121
vue3-select2

select2 component in vue3.

1,910
v-select2-multiple-component

Select 2 Multiple control for Vue

9,121

Version History

Version Released License
1.0.1 MIT
1.0.0 MIT
0.1.0 Apache-2.0