酷到爆炸

文章 评论 浏览 655

酷到爆炸 2022-05-04 13:54:10

代码

通过 webpack 打包成一个 npm 包,项目地址:https://github.com/SimpleCodeCX/simple-dialog

demo

演示地址

Install

npm install --save @simplexd/dialog

Usage

// commonjs
const Dialog = require('@simplexd/dialog');
const dialog = new Dialog();
dialog.open();

or

// es6 module
import Dialog from '@simplexd/dialog';
const dialog = new Dialog();
dialog.open();

or

// html script
<link rel="stylesheet" href="${your-asset-src-path}/simple-dialog.min.css">
<script src="${your-asset-src-path}/simple-dialog.min.js"></script>
const dialog = new SimpleDialog();
dialog.open();

Example

  const dialog1 = new Dialog();
  dialog1.open();
  dialog1.close();

  const dialog2 = new Dialog({
    title: 'dialog2 title',
    text: 'this is dialog2'
  });
  dialog2.open();
  dialog2.close();

  const dialog3 = new Dialog({
    title: 'normal dialog3',
    text: 'this is dialog3',
    size: 'normal' || 'small' || 'large'
  });
  dialog3.open();
  dialog3.close();

第 132 题:实现一个 Dialog 类,Dialog 可以创建 dialog 对话框,对话框支持可拖拽

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文