feature - trigger slot for Dropdown

pull/1460/head
Nikita Brylev 2021-08-19 19:21:56 +03:00
parent 63b1d95667
commit 681b66f563
4 changed files with 12 additions and 1 deletions

View File

@ -283,6 +283,10 @@ const DividerSlots = [
{
name: "loader",
description: "Custom content for the virtual scroller loader items"
},
{
name: "trigger",
description: "Custom content for the component's trigger"
}
];

View File

@ -53,6 +53,7 @@ declare class Dropdown {
empty: VNode[];
content: VNode[];
loader: VNode[];
trigger: VNode[];
}
}

View File

@ -11,7 +11,9 @@
</span>
<i v-if="showClear && modelValue != null" class="p-dropdown-clear-icon pi pi-times" @click="onClearClick($event)"></i>
<div class="p-dropdown-trigger" role="button" aria-haspopup="listbox" :aria-expanded="overlayVisible">
<span :class="dropdownIconClass"></span>
<slot name="trigger">
<span :class="dropdownIconClass"></span>
</slot>
</div>
<Teleport :to="appendTarget" :disabled="appendDisabled">
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave">

View File

@ -438,6 +438,10 @@ export default {
<tr>
<td>loader</td>
<td>options: Options of the loader items for virtualscroller</td>
</tr>
<tr>
<td>trigger</td>
<td>-</td>
</tr>
</tbody>
</table>