import { Pane } from "../model/Pane"; interface BreadcrumbNavIns { remove(path: string, routeToPreviousPage?: boolean, extendQuery?: any): void; add(pane: Pane, active?: boolean): void; } class BreadcrumbNavService { ins: { [key: string]: BreadcrumbNavIns } = {}; constructor() {} /** * @description: 移除面包屑 * @author ChenRui * @date 2021/2/8 14:35 */ remove(path: string, routeToPreviousPage = false, extendQuery: any = {}): void { if (this.ins) { Object.values(this.ins).forEach((item) => { item.remove(path, routeToPreviousPage, extendQuery); }); } } /** * @description: 新增面包屑 * @author ChenRui * @date 2021/2/8 14:37 */ add(srcPane: Pane, active = true): void { if (this.ins) { Object.values(this.ins).forEach((item) => { item.add(srcPane, active); }); } } } const breadcrumbNavService: BreadcrumbNavService = new BreadcrumbNavService(); export { BreadcrumbNavIns, BreadcrumbNavService, breadcrumbNavService };