2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

overhaul option slot

This commit is contained in:
Jeff
2019-10-30 18:08:09 -07:00
parent 642e61c48e
commit 7f069a1c26
+3 -7
View File
@@ -52,12 +52,8 @@
<transition :name="transition">
<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">
<li
role="option"
v-bind="getDropdownOptionScope(option, index).attributes"
v-on="getDropdownOptionScope(option, index).events"
>{{ getOptionLabel(option) }}</li>
<slot name="option" v-for="scope in normalizedFilteredOptions" v-bind="scope">
<li v-bind="scope.attributes" v-on="scope.events">{{ getOptionLabel(scope.option) }}</li>
</slot>
<li v-if="!filteredOptions.length" class="vs__no-options" @mousedown.stop="">
<slot name="no-options">Sorry, no matching options.</slot>
@@ -1073,7 +1069,7 @@
},
normalizedFilteredOptions() {
return this.filteredOptions.map(option => this.normalizeOptionForSlot(option));
return this.filteredOptions.map((option, index) => this.getDropdownOptionScope(this.normalizeOptionForSlot(option), index));
},
/**