In primeng breadcrumbs we can display items only , is there a way to display dropdown on item when clicked ?
CodePudding user response:
There's no built-in way to do it with the primeng Breadcrumb component. It doesn't use custom templates for rendering the items and the input for the items is of type MenuItem[] (I pasted the MenuItem interface below).
You can style the items but not change their core structure, which is basically just an icon and/or label that can also navigate to another page when clicked.
interface MenuItem {
label?: string;
icon?: string;
command?: (event?: any) => void;
url?: string;
items?: MenuItem[];
expanded?: boolean;
disabled?: boolean;
visible?: boolean;
target?: string;
escape?: boolean;
routerLinkActiveOptions?: any;
separator?: boolean;
badge?: string;
tooltip?: string;
tooltipPosition?: string;
badgeStyleClass?: string;
style?:any;
styleClass?:string;
title?: string;
id?: string;
automationId?: any;
tabindex?: string;
routerLink?: any;
queryParams?: { [k: string]: any };
fragment?: string;
queryParamsHandling?: QueryParamsHandling;
preserveFragment?: boolean;
skipLocationChange?: boolean;
replaceUrl?: boolean;
state?: {
[k: string]: any;
}
tooltipOptions?: {
tooltipLabel?: string;
tooltipPosition?: string;
tooltipEvent?: string;
appendTo?: any;
positionStyle?: string;
tooltipStyleClass?: string;
tooltipZIndex?: string;
escape?: boolean;
disabled?: boolean;
positionTop?: number;
positionLeft?: number;
showDelay?: number;
hideDelay?: number;
life?: number;
}
}
CodePudding user response:
As the previous answer already said - NO build-in functionality but
since the PrimeNG has MIT License you can extend the source and add dropdown functionality as you want
