您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

12 行
325 B

  1. // ** Imports createContext function
  2. import { createContext } from 'react'
  3. // ** Imports createContextualCan function
  4. import { createContextualCan } from '@casl/react'
  5. // ** Create Context
  6. export const AbilityContext = createContext()
  7. // ** Init Can Context
  8. export const Can = createContextualCan(AbilityContext.Consumer)