Refactor the MultiSelect
component to use select2, keeping its API.
- select2 API:
- initialize:
$(selectEl).select2({ multiple: true })
- emits
change
event -$(selectEl).on('change', handler)
- get value:
$(selectEl).val()
- set value:
$(selectEl).val(newValue).trigger('change')
- destroy:
$(selectEl).select2('distroy')
- initialize:
- initialize in
mounted()
, cleanup inbeforeDestroy()
- use
this.$el
, the component's root DOM element