Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beisen-phoenix/unmodeled-layer

Package Overview
Dependencies
Maintainers
1
Versions
440
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beisen-phoenix/unmodeled-layer

使用 rc-trigger 来实现弹框可见性的控制, 包括动画,定位等信息, 封装 rc-trigger,实现自适应位置

  • 3.3.55
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

@beisen-phoenix/unmodeled-layer

使用 rc-trigger 来实现弹框可见性的控制, 包括动画,定位等信息, 封装 rc-trigger,实现自适应位置

API 属性如下:
成员说明类型默认值
visible是否显示boolean-
size尺寸大小: small(170px) large(340px) auto(与父级自适应)string-
width自定义大小,优先级低于 sizenumber-
autoSize是否监听弹层的大小变化Booleantrue
childMargin子组件的外边距string0px
trigger触发展示的行为: hover clickArray<'hover' 'click'>[ 'hover']
footer自定义按钮object-
autoAdjust是否自适应调整位置Booleantrue
content弹窗内容ReactNode-
stretch弹层拉伸string('width'、 'minWidth'、 'height'、 'minHeight')-
onVisibleChange弹层显示状态改变时调用, 参数为 visibleFunction(visible)-
onOk默认确定按钮的回调函数Function-
extraCls自定义 classstring""
blockContainer外层容器的显示类型(true 是 block 类型,false 则是 inline-block)Booleanfalse
placement弹层的显示位置(可选值:topLeft, topRight, bottomRight, bottomLeft)stringbottomLeft
builtinPlacements弹层的可定义偏移位置(具体可参考 dom-align)object--
getPopupContainer弹层挂载的容器Function-
destroyPopupOnHide隐藏的时候是否销毁节点booleanfalse
builtinPlacements 取值举例
{
  topLeft: {
    points: ['bl', 'tl'],
  },
  topRight: {
    points: ['br', 'tr'],
  },
  bottomRight: {
    points: ['tr', 'br'],
  },
  bottomLeft: {
    points: ['tl', 'bl'],
    offset: [-11, -15]
  },
}
代码示例
let footer = [{
  text: '按钮1',
  onClick: ()=> console.log("按钮1")
}, {
  text: '按钮2',
  onClick: ()=> console.log("按钮2")
}]
<UnmodeledLayer
  visible={visible}
  size = 'small'
  footer={footer}
  trigger={['hover', 'click']}
  content={content}
  onOk={this.handleOk}
  onVisibleChange={this.onVisibleChange}
  >
  <Button>打开</Button>
</UnmodeledLayer>

FAQs

Package last updated on 25 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc