Merge pull request #1460 from nbrylevv/dropdown-trigger-slot

feature - trigger slot for Dropdown
pull/1533/head
Cagatay Civici 2021-08-27 16:53:40 +03:00 committed by GitHub
commit 2670b1e539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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>