LibraryProvider
A required component of the component library, responsible for initializing the environment context of the component library and providing a uniform global configuration for the component
When To Use
- Required component for component library initialization
Properties
key | value type | property explanation | get source |
---|---|---|---|
getPopupContainer | function | Returns the mount point of the internal mod of the component library | |
tenant | string | tenant key | QianKunProps?.context?.env?.TENANT_KEY |
workspaceKey | string | spacekey | QianKunProps?.context?.env?.WORKSPACE_KEY |
locale | zh/en | language | QianKunProps?.context?.env?.LOCALES ? 'en' |
teamGateway | string | team gateway | QianKunProps?.context?.env?.PROXIMA_GATEWAY |
teamBasePath | string | team basePath | QianKunProps?.context?.env?.PROXIMA_BASE_PATH |
item.fetchItemById | function | fetch item by itemId | fetch /parse/api/items/:id/values |
workflow.checkTransitionScript | function | Validate workflow script | fetch vm |
workflow.fetchRole | function | Get permission information | fetch /parse/api/permission/user/:workspaceId |
workflow.getWorkflowData | function | Get item workflow configuration | fetch /parse/api/workflows/item/:itemId |
workflow.runTransition | function | Workflow transition | fetch Parse.Cloud.run('transition', params) |
workflow.getItemStatus | function | Get item status | fetch Parse.Query(Item) |
import {LibraryProvider} from '@giteeteam/apps-team-components';
<LibraryProvider
sessionToken={sessionToken}
getPopupContainer={getContainer}
tenant={TENANT_KEY}
workspaceKey={workspaceKey}
locale={locales}
teamGateway={teamGateway}
teamBasePath={teamBasePath}
item={{fetchItemById}}
workflow={{
checkTransitionScript,
fetchRole,
getWorkflowData,
runTransition,
getItemStatus,
}}
>
</LibraryProvider>