如何解决搜索 abp 商业菜单项
我正在使用 abp 商业 Angular 客户端,我想搜索主菜单项,例如 Asp.net 零搜索功能。有没有办法做到这一点,或者您是否计划在路线图中添加此功能? 谢谢,
解决方法
目前,无法仅添加搜索输入。您可以使用 component replacement,但您必须自己实现模板。
import { ReplaceableComponentsService } from '@abp/ng.core';
import { APP_INITIALIZER,Component } from '@angular/core';
import { eThemeLeptonComponents,RoutesComponent } from '@volo/abp.ng.theme.lepton';
@Component({
selector: 'app-menu',template: `<!-- template here -->`,})
export class MenuComponent extends RoutesComponent {
// this will inherit all props and
}
export const APP_MENU_PROVIDER = [
{
provide: APP_INITIALIZER,useFactory: switchMenus,multi: true,deps: [ReplaceableComponentsService],},];
export function switchMenus(replaceableComponents: ReplaceableComponentsService) {
return () => {
replaceableComponents.add({
component: MenuComponent,key: eThemeLeptonComponents.Routes,});
};
}
在您的 APP_MENU_PROVIDER
中导入并添加 AppModule
,您将看到菜单已被替换。另一方面,这并不像人们希望的那样实用。为 v4.3 计划了额外的自定义选项。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。