Skip to content

Add level Prop to content-top Slot in UDropdownMenu #5606

@allahyar

Description

@allahyar

Package

v4.x

Description

I'm using the UDropdownMenu component and need to display a toolbar only at the first level of a nested dropdown menu. Currently, it seems the content-top slot doesn't have access to information about which menu level it's currently rendering in.

My use case example:

<UDropdownMenu>
    <UButton size="sm" color="info" variant="ghost" />
    
    <template #content-top="{ level }">
        <div v-if="level === 1">
            Toolbar (should only appear in first level)
        </div>
    </template>
</UDropdownMenu>

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp3-lowMinor cosmetic, edge case, or documentation issuev4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions