0.1.0 • Published 7 years ago

milkui-popup v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

milkui-popup

在点击控件或者某个区域后,浮出一个气泡菜单来做更多的操作。 如果设置了遮罩层,建议通过点击遮罩层的任一位置,进行退出。

Overview

image

Example

import Popup from 'milkui-popup';

<Popup
  placement="bottomRight"
  content={popupContent}
  offsetX={-20}
  offsetY={10}
>
  <Icon className="demo__icon demo__bar__icon" glyph={iconEllipsis} />
</Popup>

// popupContent
<div className="demo__popup-content">
  <div className="item">
    <Icon className="demo__icon item__icon" glyph={iconScan} />
    <span>扫一扫</span>
  </div>
  <div className="item">
    <Icon className="demo__icon item__icon" glyph={iconQrcode} />
    <span>我的二维码</span>
  </div>
  <div className="item">
    <Icon className="demo__icon item__icon" glyph={iconHelp} />
    <span>帮助</span>
  </div>
</div>

Properties

PropertyTypeDescriptionDefault
placementString显示位置'bottomLeft'
contentClassNameString自定义的 class 类名''
adjustableBoolean定位是否自适应true
maxWidthNumber显示内容的最大宽度200
offsetXNumber内容区定位后的 x 轴的偏移量0
offsetYNumber内容区定位后的 y 轴的偏移量0
contentReact node显示内容''
containerNodeReact node显示内容的容器document.body

Develop

cnpm i milk-dev -g    # dev tool

cnpm install

npm start

Links