Hello Team,
I am using our primereact menu and i have to set to different methods to my label and my icon.
currently, we can apply only one method to both. Can you please help me in this.
Add 2 different method to lable and icon in Primereact Menu
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Hello,
I think you can use template option to custom menu items. Please see;
https://primefaces.org/primereact/showcase/#/menumodel
Best Regards,
I think you can use template option to custom menu items. Please see;
https://primefaces.org/primereact/showcase/#/menumodel
Code: Select all
{
label: 'New',
template: (item, options) => {
return (
/* custom element */
<a className={options.className} target={item.target} onClick={options.onClick}>
<span onClick={...} className={classNames(options.iconClassName, 'pi pi-home')}></span>;
<span onClick={...} className={options.labelClassName}>{item.label}</span>;
</a>
);
}
}
Best Regards,
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 19 guests