lm-portal
v0.2.3
Published
* 作者:David Feng * 邮箱:[email protected] * 版本:**`0.2.0`**
Downloads
37
Readme
portal
- 作者:David Feng
- 邮箱:[email protected]
- 版本:
0.2.0
介绍
任意组件传送门
安装
lm-*
组件使用 npm
进行管理,命名空间统一为 lm-
,请使用以下命令进行组件安装。
npm i lm-portal --save
- 如果你还没有安装
npm
,可通过以下方式进行 安装。 - 安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用
样例文档
- 待开发
使用
最少配置参数为:
- 传入
content
增加内容
<Portal>
<div>被转移的dom</div>
</Portal>
配置参数
| Prop | Type | Default | Description |
| ---- |:----:|:-------:| :----------:|
| children
| | undefined
| 被转移的子元素 |
| target
| dom | body
| 目标插入参数 默认是body |
| alwaysAppend
| bool | true
| 是否每次更新都始终执行 append (废弃掉的API,老版本<16时候会用到 升级>=16之后就被废弃了) |
| className
| string | undefined
| 外层容器 class 名 |
注意事项
- 组件注意事项
开发调试
进入项目目录后,使用 node
命令启动服务
npm run start
打包发布可通过 node
命令执行
npm run build
npm publish
相关资料
Changelog
0.2.0
- init react 16+