How to limit selected items in vue-select?
问题 I use vue-select for multiple values. Here is an example: https://codepen.io/sagalbot/pen/opMGro I have the following code: <v-select multiple v-model="selected" :options="options"></v-select> And JS: Vue.component('v-select', VueSelect.VueSelect) new Vue({ el: '#app', data: { selected: ['foo','bar'], options: ['foo','bar','baz'] } Thank you! 回答1: You can use the v-on:input listener to see how many items are selected. Then pass it a simple function as: <v-select multiple v-model="selected"