All Projects → godbasin → vue-select2

godbasin / vue-select2

Licence: MIT license
select2 component in vue.

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to vue-select2

Select2
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
Stars: ✭ 25,184 (+23004.59%)
Mutual labels:  select2
Select2 Bootstrap4 Theme
A theme for Select2 v4 and Bootstrap 4
Stars: ✭ 97 (-11.01%)
Mutual labels:  select2
select2-treeview
github.com/select2/select2/pull/4717
Stars: ✭ 20 (-81.65%)
Mutual labels:  select2
Select2 Bootstrap Theme
A Select2 v4 Theme for Bootstrap 3
Stars: ✭ 841 (+671.56%)
Mutual labels:  select2
Stf Vue Select
stf vue select - most flexible and customized select
Stars: ✭ 61 (-44.04%)
Mutual labels:  select2
Django Easy Select2
Select2 input widget for django selectable fields.
Stars: ✭ 165 (+51.38%)
Mutual labels:  select2
Cc
一个基于angular5.0.0+ng-bootstrap1.0.0-beta.8+bootstrap4.0.0-beta.2+scss的后台管理系统界面(没基础的同学请先自学基础,谢谢!)
Stars: ✭ 416 (+281.65%)
Mutual labels:  select2
angular2-select
No description or website provided.
Stars: ✭ 12 (-88.99%)
Mutual labels:  select2
Countrycity
🌎 Geodata API - Get countries, and cities to plug in a select drop-down.
Stars: ✭ 62 (-43.12%)
Mutual labels:  select2
craft-select2
Filter / search a <select> using the popular Select2 fieldtype for Craft CMS
Stars: ✭ 18 (-83.49%)
Mutual labels:  select2
Laravel Dusk Select2
Select2.js support for the Laravel Dusk testing
Stars: ✭ 31 (-71.56%)
Mutual labels:  select2
Danyuan Application
初学者 spirng-boot版本
Stars: ✭ 47 (-56.88%)
Mutual labels:  select2
FormBundle
Bunch of FormTypes extending some basic Symfony PHP framework FormTypes. ExtensibleTypes makes it possible to allow extra choices by Symfony ChoiceTypes (ChoiceType, EntityType and DocumentType). This can help to make it work with the Select2 jQuery pluggin.
Stars: ✭ 14 (-87.16%)
Mutual labels:  select2
Angular Select2
select2 in angular(>=2.0-release).
Stars: ✭ 16 (-85.32%)
Mutual labels:  select2
docs
DEPRECATED - Now located in docs directory of main repository
Stars: ✭ 47 (-56.88%)
Mutual labels:  select2
Choices
A vanilla JS customisable select box/text input plugin ⚡️
Stars: ✭ 4,505 (+4033.03%)
Mutual labels:  select2
React Select2 Wrapper
Wrapper for Select2
Stars: ✭ 163 (+49.54%)
Mutual labels:  select2
select2-bootstrap-5-theme
A Select2 v4 theme for Bootstrap 5
Stars: ✭ 110 (+0.92%)
Mutual labels:  select2
capybara select2
Capybara helpers for https://select2.org select box (supports Select2 version 2/3/4)
Stars: ✭ 48 (-55.96%)
Mutual labels:  select2
ng2-iq-select2
Angular 2 native select 2 implementation based on bootstrap 3
Stars: ✭ 26 (-76.15%)
Mutual labels:  select2

Vue Select2 Component

This project was generated with Vue cli version 2.9.1.

Instructions

This project is built for showing how to use v-select2-component.

If you want to use it in Vue 3.0, check vue3-select2-component.

v-select2-component

Source code in: https://github.com/godbasin/vue-select2/tree/npm-publish-code.

Related Versions

Vue-Select2-Component is baseed on these plugins and libs(version):

How to use


Install

// npm install
npm install v-select2-component --save

Use as component

  1. import as global component.
// import Select2Component
import Select2 from 'v-select2-component';

Vue.component('Select2', Select2);
new Vue({
	// ...
})
  1. import into a single component.
// import Select2Component
import Select2 from 'v-select2-component';

<template>
  <div>
    <Select2 v-model="myValue" :options="myOptions" :settings="{ settingOption: value, settingOption: value }" @change="myChangeEvent($event)" @select="mySelectEvent($event)" />
    <h4>Value: {{ myValue }}</h4>
  </div>
</template>
<script>
export default {
    // declare Select2Component
    components: {Select2},
    data() {
        return {
            myValue: '',
            myOptions: ['op1', 'op2', 'op3'] // or [{id: key, text: value}, {id: key, text: value}]
        }
    },
    methods: {
        myChangeEvent(val){
            console.log(val);
        },
        mySelectEvent({id, text}){
            console.log({id, text})
        }
    }
}
</script>

Options

  • options: option[]
    • select options for select2
    • option: {id: key, text: value} or string
  • v-model: option value that is selected
    • id or string while multiple is disable
    • id[] or string[] while multiple is enable
  • disabled
    • if select is disabled
  • settings
    • configurable settings, see Select2 options API
    • setting: { settingOption: value, settingOption: value }

Events

  • change
    • triggered when option selected change
    • return value
    • parmas: same with v-model
  • select
    • triggered when option selected
    • parmas: option({id: value, text: key, selected: ifSelected} or string)
  • open
    • triggered whenever the dropdown is opened
  • close
    • triggered whenever the dropdown is closed
  • clear
    • triggered whenever the dropdown is cleared
  • more events refer to select2 events
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].