Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 2.65 KB

File metadata and controls

71 lines (52 loc) · 2.65 KB

@rc-component/portal

Ant Design Ant Design 生态的一部分。

🌀 支持生命周期与容器管理的 React Portal 基础组件。

NPM version npm downloads build status Codecov bundle size dumi

English | 简体中文

亮点

方向 支持
定位 支持生命周期与容器管理的 React Portal 基础组件。
包名 @rc-component/portal
发布 @rc-component/np / rc-np

安装

npm install @rc-component/portal

用法

import Portal from '@rc-component/portal';

export default () => <Portal open>Hello World</Portal>;

API

名称 说明 类型 默认值
getContainer 自定义 Portal 容器。 Element | () => Element | string | false document.body
open 是否渲染 Portal 内容。 boolean false
autoLock Portal 打开时锁定页面滚动。 boolean false

本地开发

npm install
npm start
npm test
npm run lint
npm run tsc
npm run compile

本地 dumi 站点默认运行在 http://localhost:8000.

发布

npm run prepublishOnly

发布流程通过 @rc-component/np 提供的 rc-np 命令处理。

许可证

@rc-component/portal 基于 MIT 协议发布。