micro-ui-y
Version:
102 lines (73 loc) • 2.72 kB
Plain Text
1.安装
npm install micro-ui-y --save
2.引用
import {Button, Dialog} from 'micro-ui-y'
3.dialog API 属性
属性名(name) 类型(type) 必要性(Required) 默认值(default) 描述(description)
open Boolean true false 是否显示弹出框
handleClose Function false 点击旁边触发的办法,可关闭弹出框
title String false 弹出框的标题
actions ArrayDom false 底部按钮传参
bgStyle Object false 弹出背景
contentStyle Object false 弹出内容白色框
titleStyle Object false dialog标题样式
bodyStyle Object false dialog内容样式
actionStyle Object false dialog按钮框样式
4. 使用方式
import React, {Component, PropTypes} from 'react';
import {Button, Dialog} from '../index'
class TestDialog extends Component {
constructor(props) {
super(props);
this.state = {
open: false,
}
};
showDialog = () => {
this.setState({
open: true,
})
};
handleClose = () => {
this.setState({
open: false,
})
};
componentDidMount() {
}
render() {
const bgStyle = {};
const contentStyle = {};
const titleStyle = {};
const bodyStyle = {};
const actionStyle = {};
//可传一个或者两个
const actions = [
<Button scenesType="submit" btnText="确认" handleBtn={this.handleClose}/>,
<Button scenesType="back" btnText="返回" handleBtn={this.handleClose}/>
];
return (
<div>
<div onClick={this.showDialog}>弹框</div><br/><br/>
<Dialog open={this.state.open}
// handleClose={this.handleClose}
title="休假申请"
actions={actions}
//bgStyle={bgStyle}
//contentStyle={contentStyle}
//titleStyle={titleStyle}
// bodyStyle={bodyStyle}
// actionStyle={actionStyle}
>
<div>
這裡是弹出主要内容
</div>
</Dialog>
</div>
)
};
}
export default TestDialog;
5.help
fuyan Gu
1303928929.com