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", name: "loader",
description: "Custom content for the virtual scroller loader items" 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[]; empty: VNode[];
content: VNode[]; content: VNode[];
loader: VNode[]; loader: VNode[];
trigger: VNode[];
} }
} }

View File

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

View File

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