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

Add a higher level slot to labels so they can be customized completely

This commit is contained in:
Thom Hurks
2017-10-23 22:16:41 +02:00
parent f836eaeb6a
commit cbdc5982fd
+11 -8
View File
@@ -282,14 +282,17 @@
<div :dir="dir" class="dropdown v-select" :class="dropdownClasses">
<div ref="toggle" @mousedown.prevent="toggleDropdown" :class="['dropdown-toggle', 'clearfix', {'disabled': disabled}]">
<span class="selected-tag" v-for="option in valueAsArray" v-bind:key="option.index">
<slot name="selected-option" v-bind="option">
{{ getOptionLabel(option) }}
</slot>
<button v-if="multiple" @click="deselect(option)" type="button" class="close" aria-label="Remove option">
<span aria-hidden="true">&times;</span>
</button>
</span>
<slot v-for="option in valueAsArray" name="selected-option-container"
:option="option" :deselect="deselect">
<span class="selected-tag" v-bind:key="option.index">
<slot name="selected-option" v-bind="option">
{{ getOptionLabel(option) }}
</slot>
<button v-if="multiple" @click="deselect(option)" type="button" class="close" aria-label="Remove option">
<span aria-hidden="true">&times;</span>
</button>
</span>
</slot>
<input
ref="search"