@tsx-react-ui/portal
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@tsx-react-ui/portal

介绍

The portal component of the react written in Typescript


安装

组件使用 npm 进行管理,请使用以下命令进行组件安装:

npm i @tsx-react-ui/portal --save
  • 安装cnpm npm install -g cnpm --registry=https://registry.npm.taobao.org

使用

样例文档

  • 待开发

使用

最少配置参数为:

  • 传入children增加内容
<Portal>
    <div>我被转移到body下了</div>
</Portal>

详细配置:

<Portal className="test" target={() => document.getElementById('test')}>
    <div>我被转移到body下了</div>
</Portal>

配置参数

Prop Type Default Description
children ReactNode undefined 被传送的组件
target function () => document.body 返回目标元素
className string undefined 自定义样式名

Changelog


Package Sidebar

Install

npm i @tsx-react-ui/portal

Weekly Downloads

0

Version

1.0.3

License

none

Unpacked Size

10.6 kB

Total Files

10

Last publish

Collaborators

  • ideas-ma
  • maqing01