Releases: shentao/vue-multiselect
Releases · shentao/vue-multiselect
v1.1.1
v1.1.0
New:
#77 Introduce support for custom option’s template.
Example from the README:
Using Vue’s partial API
multiselect(
:options="styleList",
:selected="selectedStyle",
:option-height="130",
:custom-label="styleLabel",
@update="updateSelectedStyle",
option-partial="customOptionPartial"
placeholder="Fav No Man’s Sky path"
label="title"
key="title"
)import customOptionPartial from './partials/customOptionPartial.html'
Vue.partial('customOptionPartial', customOptionPartial)
// ...Inside Vue component
methods: {
styleLabel ({ title, desc }) {
return `${title} – ${desc}`
},
updateSelectedStyle (style) {
this.selectedStyle = style
}
}<div>
<img class="option__image" :src="option.img" alt="No Man’s Sky" />
<div class="option__desc">
<span class="option__title">{{ option.title }}</span>
<span class="option__small">
{{ option.desc }}
</span>
</div>
</div>v1.0.1
v1.0.0
New
- Added
idprop, which is now passed along all events and can be used to identify which instance emitted the event. - API is now events based:
@update– called after each change, passes thevalueandid@select– called after selecting an element, passes theselectedOptionandid@remove– called after removing an element, passes theremovedOptionandid@open– called after opening the dropdown, passes theid@close– called after closing the dropdown, passes thevalueandid@tag– called after attempting to create a tag, passes thesearchQueryandid@search-change– called after the search query changes, passes thesearchQueryandid
- The
deepClonefunction is now available as importimport { deepClone } from 'vue-multiselect' - Added
loadingprop, which shows/hides the spinner - Added
disabledprop, which disables the component if true - The
selectedprop is no longer required
Breaking Changes
- Two-way binding is deprecated. Please do NOT use
.syncanymore. Vue-Multiselect will never change anything outside of its own scope. - To propagate changes (updating
selectedvalue) inside parent component, you always need to listen to@updateevent. An example update function could look like this:
onUpdate (newVal) { this.selected = newVal }- Props with callback functions like:
onChange,onSearchChangeare now deprecated. Use events instead. touchedprop is deprecated. Use@opento detect if the component has been touched.
Fixed
- #72 If vue-multiselect is inside a
fieldsetwhich has thedisabledattribute, the component will be also partially disabled (pointer-events: none). IE11+ - #70
- #62
- #60
- #48
Additionally added some tweaks to the code