@dreamland/react-dialog

1.0.0 • Public • Published

INSTALL

npm install @dreamland/react-dialog --save

USEAGE

import Dialog from '@dreamland/react-dialog'
<Dialog data={{
	title: '',
	content: 'Alert',
	type: 'alert',
	sureClick: () => {}
	}} />

USE WITH REDUX

// action import * as dialogActions from '@dreamland/react-dialog/lib/action'
// reducer
import dialogData from '@dreamland/react-dialog/lib/reducer'

import Dialog from '@dreamland/react-dialog'
import Immutable from 'immutable'

<Dialog data={dialogData} />

dispatch(dialogActions.alert('Alert'))

PARAMS

@param title {?string} 标题,为空不显示标题区域,也可以在content中自己实现
@param content {!string} 提示内容,可以是html串
@param type {?'alert'|'confirm'} 在btns为空时判断type值来自动填充按钮
@param btns {?[{text: string, click: fn}]} 自定义的按钮
@param sureClick {?fn} 确定按钮回调
@param cancelClick {?fn} 取消按钮回调
@param show {!boolean} 显示控制开关
@param align {?'left'|'center'} 内容靠左、居中显示

TIPS

1. 当内容出现滚动条时,使用iscroll的滑动效果,避免弹框底部的滚动,依赖iscroll

Package Sidebar

Install

npm i @dreamland/react-dialog

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • dreamland