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

adding custom template for option and selected-option

This commit is contained in:
Edwin de Jonge
2017-05-02 10:20:56 +02:00
parent 072bf4160d
commit 7c6217bc47
3 changed files with 16 additions and 2 deletions
+5 -1
View File
@@ -270,7 +270,9 @@
<div ref="toggle" @mousedown.prevent="toggleDropdown" class="dropdown-toggle">
<span class="selected-tag" v-for="option in valueAsArray" v-bind:key="option.index">
{{ getOptionLabel(option) }}
<slot name="selected-option" v-bind="option">
{{ getOptionLabel(option) }}
</slot>
<button v-if="multiple" @click="deselect(option)" type="button" class="close">
<span aria-hidden="true">&times;</span>
</button>
@@ -305,7 +307,9 @@
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }">
<li v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
<a @mousedown.prevent="select(option)">
<slot name="option" v-bind="option">
{{ getOptionLabel(option) }}
</slot>
</a>
</li>
<li v-if="!filteredOptions.length" class="no-options">