mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
overhaul option slot
This commit is contained in:
@@ -52,12 +52,8 @@
|
|||||||
|
|
||||||
<transition :name="transition">
|
<transition :name="transition">
|
||||||
<ul ref="dropdownMenu" v-if="dropdownOpen" class="vs__dropdown-menu" role="listbox" @mousedown.prevent="onMousedown" @mouseup="onMouseUp">
|
<ul ref="dropdownMenu" v-if="dropdownOpen" class="vs__dropdown-menu" role="listbox" @mousedown.prevent="onMousedown" @mouseup="onMouseUp">
|
||||||
<slot name="option" v-for="(option, index) in normalizedFilteredOptions">
|
<slot name="option" v-for="scope in normalizedFilteredOptions" v-bind="scope">
|
||||||
<li
|
<li v-bind="scope.attributes" v-on="scope.events">{{ getOptionLabel(scope.option) }}</li>
|
||||||
role="option"
|
|
||||||
v-bind="getDropdownOptionScope(option, index).attributes"
|
|
||||||
v-on="getDropdownOptionScope(option, index).events"
|
|
||||||
>{{ getOptionLabel(option) }}</li>
|
|
||||||
</slot>
|
</slot>
|
||||||
<li v-if="!filteredOptions.length" class="vs__no-options" @mousedown.stop="">
|
<li v-if="!filteredOptions.length" class="vs__no-options" @mousedown.stop="">
|
||||||
<slot name="no-options">Sorry, no matching options.</slot>
|
<slot name="no-options">Sorry, no matching options.</slot>
|
||||||
@@ -1073,7 +1069,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
normalizedFilteredOptions() {
|
normalizedFilteredOptions() {
|
||||||
return this.filteredOptions.map(option => this.normalizeOptionForSlot(option));
|
return this.filteredOptions.map((option, index) => this.getDropdownOptionScope(this.normalizeOptionForSlot(option), index));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user