Socket
Socket
Sign inDemoInstall

@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,实现自适应位置 #### API属性如下:


Version published
Weekly downloads
7
decreased by-99.22%
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-
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 30 Jul 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