0.0.4 • Published 4 years ago

react-layui-layer v0.0.4

Weekly downloads
12
License
ISC
Repository
github
Last release
4 years ago

🎉 layui 弹层组件 - layui.layer React 封装 V0.0.4

示例图

📦 安装

npm i react-layui-layer --save

🔨 示例

import Layer from 'react-layui-layer';
showWindow = () => {
     this.setState({
         isShow: true
     });

 };
onCancel = () => {
     this.setState({
         isShow: false
     });

 };
   render() {
        const {isShow,isShow2,windowsArray} = this.state;
        console.log(isShow2);
        return (
            <div className="App">
                <button onClick={this.showWindow}>打开窗口</button>
                <Layer visible={isShow} onCancel={this.onCancel}>
                         <span>测试数据</span>
                </Layer>
             </div>
        )
   }

📚 文档

参数说明类型默认值
visible是否显示窗体Booleanfalse
shade遮罩 即弹层外区域。例如0.3为透明度0.3的黑色背景('#000')Number0
type基本层类型 可传入的值有:1(页面层,子节点为dom)2(iframe层,子节点为地址)Number1
title标题 弹出框的标题String-
maxmin最大最小化 该参数值对该参数值对type:1 type:2 有效,默认显示最大小化按钮。Booleantrue
width窗体宽度String800px
height窗体高度String500px
onCancel当关闭窗体时回调方法function-