1.0.16 • Published 4 years ago

route-function-interceptor v1.0.16

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

项目内菜单权限拦截组件 - route-function-interceptor

快速开始

yarn

yarn add @coding-frontend/route-function-interceptor --registry=https://codingcorp-npm.pkg.coding.net/micro-frontend/public-npm/

在模块入口添加以下逻辑

import { RouteFunctionInterceptor, justConnect } from '@coding-frontend/route-function-interceptor';

routerFunctionsInterceptor({ key: KEY_CONFIG.TEST_MANAGEMENT })(
    withRouter(justConnect(mapStateToProps)(FeieContainer))
);

// 子应用内部有独立的 store 时, 使用公共的context避免冲突
const context = React.createContext()

routerFunctionsInterceptor({ key: KEY_CONFIG.TEST_MANAGEMENT, context })(
    withRouter(justConnect(mapStateToProps)(FeieContainer))
);

接口说明

export interface IRouteFunctionInterceptorProps {
    isClosedFunction: (key: string) => boolean;
}
declare const RouteFunctionInterceptorWrapper: (options?: TOptions) => (Component: React.ElementType) => any;
export const RouteFunctionInterceptor = RouteFunctionInterceptorWrapper;
export function justConnect(store: any, actions?: {}, onContext?: AnyFn, context?: any): any;
export declare const getPdConfig: (value: string) => boolean;
export declare const isPDVersion: () => boolean;

.npmrc 参考

@coding-frontend:registry=https://codingcorp-npm.pkg.coding.net/micro-frontend/public-npm/
1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago