npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-dialog-rexsheng

v1.0.5

Published

A Vue.js plugin for providing alert,modal and others

Readme

vue-dialog-rexsheng

A Vue.js plugin for proving alert,modal...

Build Setup

# install plugin
npm install vue-dialog-rexsheng --save-dev

# config in entry file like 'src/main.js'
import dlg from 'vue-dialog-rexsheng';
//default instanceName is "$dialog",you can use this.$dialog.alert() in pages
Vue.use(dlg,{instanceName:"$dialog"})

用法

<template>
  <div>
    <h3>{{title}}</h3>
    <button type="button" @click="showAlert">Alert</button>
    <input type="checkbox" v-model="checked">
    <button type="button" @click="showConfirm">Confirm</button>
    <button type="button" @click="showHtmlConfirm">HtmlConfirm</button>
    <button type="button" @click="asyncConfirm">asyncConfirm</button>
    <button type="button" @click="showModal">showModal</button>
  </div>
</template>
<script>
import PopModalTest from "./PopModalTest";
export default {
  data() {
    return {
      title: "弹框测试页面",
      checked: true
    };
  },
  mounted() {},
  methods: {
    showAlert() {
      this.$dialog.alert("内容", "大标题", {
        showCloseBtn: this.checked
      });
    },
    showConfirm() {
      this.$dialog.confirm("内容", "大标题", {
        onConfirm: function() {
          this.$dialog.alert(
            "第二个框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个第二个框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1vddd弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1第二个弹框1vddd",
            "第二个标题",
            { width: "large" }
          );
        },
        onCancel() {
          this.$dialog.alert(
            "如今的屏幕分辨率,小至320px(iPhone),大到2560px甚至更高(大显示器),变化范围极大。",
            {
              width: "small",
              showCloseBtn: true,
              type: "error",
              showIcon: false
            }
          );
        }
      });
    },
    showHtmlConfirm() {
      this.$dialog.confirm("<span style='color:red;'>你好</span>", {
        onConfirm: () => {
          console.log("close1", this.tempData);
          // return false;
          // res(false)
          // setTimeout(()=>{
          //   res(true)
          // },1000)
          this.$dialog.alert("click ok", "", { type: "success" });
        },
        onCancel: () => {
          this.$dialog.alert("click cancel", "", { type: "warn" });
        }
      });
    },
    asyncConfirm: function() {
      this.$dialog.confirm("<span style='color:red;'>你好</span>", {
        onConfirm: cb => {
          setTimeout(() => {
            cb(true);
          }, 2000);
        }
      });
    },
    showModal: function() {
      this.$dialog.modal({
        component: PopModalTest,
        title: "标题22",
        showCloseBtn: this.checked,
        width: "1000px",
        params:{firstInput:"初始值"},
        callback: p => {
          console.log("return:", p,this.title);
          this.$dialog.alert("输入了:"+p, { type: "error" });
        }
      });
    }
  }
};
</script>

配置项

this.$dialog.alert("message","title",option)
this.$dialog.alert("message",option)
this.$dialog.alert(option)
this.$dialog.modal("componentName",option)
this.$dialog.modal(option)

option配置如下

|选项 | 说明 | 默认 | |------ |--------------- |:-----:| |title | 弹框标题 | "" | |message | 弹框内容,支持html语法 | "" | |type | 弹框类型,info success warn error | info | |width | 宽度,small large 数字+'px' | "" | |showCancelBtn | 是否显示取消按钮 | alert弹框默认为false | |showCloseBtn | 是否显示右上角close按钮 | false | |showIcon | 是否显示弹框图标 | true | |onConfirm | 点击确定按钮回调函数 | Function | |onCancel | 点击取消按钮回调函数 | Function | |confirmBtnClass | 确定按钮的样式class | RexSheng_ConfirmButton | |cancelBtnClass | 取消按钮的样式class | RexSheng_CancelButton | |component | modal弹框使用的组件 | {} | |params | modal传入组件的参数对象 | {} | |callback | modal关闭弹框的回调函数 | Function |

For detailed explanation on how things work, consult the docs for vue-dialog-rexsheng.