File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 4747 {{option.label}} ({{option.value}})
4848 </ template >
4949 </ v-select >
50+ < v-select placeholder ="custom option template for string array " taggable :options ="['cat', 'dog', 'bear'] " multiple >
51+ < template slot ="selected-option " slot-scope ="option ">
52+ {{option.label}}
53+ </ template >
54+ < template slot ="option " slot-scope ="option ">
55+ {{option.label}}
56+ </ template >
57+ </ v-select >
5058 < v-select multiple placeholder ="custom label template " :options ="options ">
5159 < span
5260 slot ="selected-option-container "
Original file line number Diff line number Diff line change 313313 <div ref =" toggle" @mousedown.prevent =" toggleDropdown" :class =" ['dropdown-toggle', 'clearfix']" >
314314
315315 <slot v-for =" option in valueAsArray" name =" selected-option-container"
316- :option =" option" :deselect =" deselect" :multiple =" multiple" :disabled =" disabled" >
316+ :option =" (typeof option === 'object')?option:{[label]: option} " :deselect =" deselect" :multiple =" multiple" :disabled =" disabled" >
317317 <span class =" selected-tag" v-bind:key =" option.index" >
318- <slot name =" selected-option" v-bind =" option" >
318+ <slot name =" selected-option" v-bind =" (typeof option === 'object')?option:{[label]: option} " >
319319 {{ getOptionLabel(option) }}
320320 </slot >
321321 <button v-if =" multiple" :disabled =" disabled" @click =" deselect(option)" type =" button" class =" close" aria-label =" Remove option" >
368368 <ul ref =" dropdownMenu" v-if =" dropdownOpen" class =" dropdown-menu" :style =" { 'max-height': maxHeight }" >
369369 <li v-for =" (option, index) in filteredOptions" v-bind:key =" index" :class =" { active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover =" typeAheadPointer = index" >
370370 <a @mousedown.prevent =" select(option)" >
371- <slot name =" option" v-bind =" option" >
371+ <slot name =" option" v-bind =" (typeof option === 'object')?option:{[label]: option} " >
372372 {{ getOptionLabel(option) }}
373373 </slot >
374374 </a >
You can’t perform that action at this time.
0 commit comments