1.0.3 • Published 7 years ago

@tsx-react-ui/portal v1.0.3

Weekly downloads
1
License
-
Repository
-
Last release
7 years ago

@tsx-react-ui/portal

  • 作者:maqing01
  • 邮箱:475986855@qq.com

介绍

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>

配置参数

PropTypeDefaultDescription
childrenReactNodeundefined被传送的组件
targetfunction() => document.body返回目标元素
classNamestringundefined自定义样式名

Changelog


1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago