Giter Site home page Giter Site logo

pxu's Introduction

pop-up-box

这是一个私人定制的弹出框插件,使用纯JS开发,也就是说您的项目文件只要允许导入JS文件就可以使用。

导入

目前,我们为小主提供两种导入方式:

第一种、通过npm install pxu安装插件

第二种、通过下载js插件

js插件目前仅可以通过clone github仓库进行下载或者直接复制当前项目中的index.js文件内容即可使用。

如果您对源码不感兴趣那么可以切换到dev分支,直接下载或者复制dist文件夹中的index.js即可。

使用

// pxu($1, $2, $3, $4, $5)
// $1 : 表示弹出框的icon图标类型
// $2 : 表示弹出框的的标题,可以是html字符串
// $3 : 表示弹窗的主要内容描述对象,可以是html字符串。
//      注意:如果html字符串中包含input,那么该标签中必须要包含id为pxu的属性,否则关闭弹出框获取不到确认数据,
//      示例:<input id="pxu" type="text" placeholder="请输入登录密码" style="..." />
// $4 : 表示弹出框的取消按钮
// $5 : 表示弹出框的确认按钮,必填项,默认为“确定”
 pxu('warning',                                // 可为null
    '您确认继续重启吗?',                        // 可为null
    '请确保您的信息填写正确后,提交后无法修改',     // 可为null
    '取消',                                     // 可为null
    '立即前往').then(res => {
   console.log(res)
 });

效果

如果您想看效果图,请切换dev分支进行查看

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.