feat(ContextMenu/DropdownMenu/NavigationMenu): add external-icon prop

Resolves #2996
This commit is contained in:
Benjamin Canac
2025-02-14 15:00:06 +01:00
parent ba3ed86ae1
commit 5846c1e2ee
14 changed files with 607 additions and 8 deletions

View File

@@ -51,6 +51,12 @@ export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>
* @defaultValue appConfig.ui.icons.loading
*/
loadingIcon?: string
/**
* The icon displayed when the item is an external link.
* Set to `false` to hide the external icon.
* @defaultValue appConfig.ui.icons.external
*/
externalIcon?: boolean | string
/**
* The content of the menu.
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
@@ -149,6 +155,7 @@ import UDropdownMenuContent from './DropdownMenuContent.vue'
const props = withDefaults(defineProps<DropdownMenuProps<T>>(), {
portal: true,
modal: true,
externalIcon: true,
labelKey: 'label'
})
const emits = defineEmits<DropdownMenuEmits>()
@@ -180,6 +187,7 @@ const ui = computed(() => dropdownMenu({
:label-key="labelKey"
:checked-icon="checkedIcon"
:loading-icon="loadingIcon"
:external-icon="externalIcon"
>
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
<slot :name="name" v-bind="slotData" />