GithubHelp home page GithubHelp logo

annagxy / x-dialog Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 755 KB

react的dialog弹层插件component,弹窗组件,自适应浮层。react-modal的深层改造

Home Page: https://react-plugin.github.io/x-dialog/

JavaScript 79.75% HTML 1.21% CSS 19.04%

x-dialog's Introduction

x-dialog

reactjs的弹窗浮层组件

我认为,每一个组件都应该有他自带的样式和属性事件回调配置。所以我会给x-dialog默认一套简单的样式,和各种默认的配置项。

演示地址: x-dialog各种案例演示

源文件地址:https://github.com/react-plugin/x-dialog

npm安装

使用 npm 安装, 运行

$ npm install x-dialog --save-dev

调用方式

import Dialog from 'x-dialog';
import 'x-dialog/lib/index.css';
<Dialog 
      isShow={true}
      title="这是一个例子"
      className="myClass"
      timer=2000
      width=300
      height=300
      buttons=<div><button className="d-ok" onClick={this.hide.bind(this)}>我知道了</button><button className="d-cancel" onClick={this.hide.bind(this)}>关闭</button></div>
      afterShow:()=>alert('我显示出来了')
      afterHide:()=>alert('我又隐藏了')
        >
    <div>这里是弹窗的内容区域</div>
</Dialog>

属性方法

isShow :bool类型

控制弹窗的显示隐藏的.

title:string类型

为空时,不显示标题.

className:string类型

弹窗的样式类

timer:number类型

定时关闭,可不传。

width:number类型

弹窗宽度,不足时,内容区域出现上下滚动

height:number类型

弹窗宽度,不足时,内容区域出现上下滚动

buttons:node类型

自定义操作区域的按钮,为false类型时不显示操作区域,不传时默认显示 `确定、取消`

okCallback:func类型

当默认按钮的情况下时,点击`确定`时的回调方法,点`取消`时直接隐藏,如果需要定制更多的方法,建议传递`buttons`属性。

afterShow:func类型

显示的回调方法

afterHide:func类型

关闭隐藏时的回调方法

关于作者

https://github.com/tianxiangbing

x-dialog's People

Contributors

tianxiangbing avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.