Socket
Socket
Sign inDemoInstall

@beisen-phoenix/popover

Package Overview
Dependencies
103
Maintainers
1
Versions
361
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @beisen-phoenix/popover

点击/鼠标移入元素,弹出气泡式的卡片浮层。


Version published
Weekly downloads
10
decreased by-97.23%
Maintainers
1
Install size
55.6 MB
Created
Weekly downloads
 

Readme

Source

点击/鼠标移入元素,弹出气泡式的卡片浮层。

概述

当目标元素有进一步的描述和相关操作时,可以收纳到卡片中,根据用户的操作行为进行展现。

和 Tooltip 的区别是,用户可以对浮层上的元素进行操作,因此它可以承载更复杂的内容,比如链接或按钮等。

API

参数说明类型默认值
content卡片内容。stringReactNode
autoAdjustOverflow气泡被遮挡时自动调整位置booleantrue
defaultVisible默认是否显隐booleanfalse
getPopupContainer浮层渲染父节点,默认渲染到 body 上Function(triggerNode)() => document.body
mouseEnterDelay鼠标移入后延时多少才显示 Tooltip,单位:秒number0
mouseLeaveDelay鼠标移出后延时多少才隐藏 Tooltip,单位:秒number0.1
extraCls卡片类名string
overlayStyle卡片样式object
placement气泡框位置,可选 top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottomstringtop
trigger触发行为,可选 hover/focus/click/contextMenustringhover
visible用于手动控制浮层显隐booleanfalse
onVisibleChange显示隐藏的回调(visible) => void
align该值将合并到 placement 的配置中,设置参考 rc-tooltipObject
isClearInnerPadding是否清除组件自身的padding设置,booleanfalse
isAutoContentWidth是否根据传入内容自定计算组件的宽度,去掉组件默认宽度限制,booleanfalse
isAutoContentHeight是否根据传入内容自定计算组件的高度,去掉组件默认高度限制,booleanfalse
contentWidth根据传入宽度设置内容区的宽度,去掉组件默认宽度限制,number
contentHeight根据传入高度设置内容区的高度,去掉组件默认高度限制,number
resize回调函数,当传入内容宽度高度发生变化时,可以在传入内容组件内部调用this.props.resize() 去重置popover位置。或者可以给popover声明一个ref,当传入内容宽度高度发生变化时,通过ref.resize()去重置popover位置回调函数

注意

请确保 Popover 的子元素能接受 onMouseEnteronMouseLeaveonFocusonClick 事件。

FAQs

Last updated on 25 Nov 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc