JSPM

  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q36579F
  • License MIT

authorized

Package Exports

  • @uiw-admin/authorized
  • @uiw-admin/authorized/esm/index.js
  • @uiw-admin/authorized/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@uiw-admin/authorized) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

authorized

Installation

npm i @uiw-admin/authorized --save

AuthPage默认导出组件

interface AuthorizedProps {
  /** 是否已经登录 */ 
  authority?: boolean;
  children: JSX.Element;
  /** 未登录重定向路径 默认 /login */ 
  redirectPath?: string;
}

getAuthPath

判断是否有权限

type getAuthPath = (path?: string)=>boolean 

AuthBtn

外层嵌套 组件,判断子组件是否有权限展示或使用

export interface AuthBtnProps {
  /** 路径 */
  path?: string;
  /** 禁用 状态 展示   适用于 存在 disabled 属性的组件  */
  disabled?: boolean;
  children: React.ReactNode;
}