route-function-interceptor
v1.0.16
Published
## 快速开始
Downloads
56
Readme
项目内菜单权限拦截组件 - 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/