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

echo_msg_box

v1.1.1

Published

## 功能说明 ```

Readme

echo_msg_box

功能说明


适用于vue项目的模态对话框组件, 窗口被关闭后, 它默认会返回一个Promise对象便于进行后续操作的处理。具体参数见下方选项说明。参数命名及说明参考了Element-UI的设计。

npm安装

npm install echo_msg_box --save

使用


main.js:
import echo_msg_box from "echo_msg_box";
Vue.use(echo_msg_box);

foo.vue:
this.$echoMsgBox({
    options
}).then(res=>{// 通过点击确定按钮关闭的回调}).catch(err=>{// 通过点击取消按钮, 关闭图标, 遮罩层关闭的回调});

选项

参数: title
说明: 弹框标题
类型: String
默认值: '提示'
参数: message
说明: 弹框消息正文
类型: String
默认值: '这是一条提示'
参数: dangerouslyUseHTMLString
说明: 是否将 message 属性作为 HTML 片段处理
类型: Boolean
默认值: false
参数: type
说明: 消息类型,不同消息类型对应不同的图标
类型: String
默认值: 'info'
可选值: 'info','success','warning','error'
参数: iconClass
说明: 自定义图标的类名,会覆盖 type参数, 添加在.msg-box .hint上
类型: String
参数: customClass
说明: 弹框的自定义类名, 添加在.msg-box上
类型: String
参数: showClose
说明: 是否显示关闭按钮
类型: Boolean
默认值: true
参数: roundButton
说明: 是否使用圆角按钮
类型: Boolean
默认值: false
参数: closeOnClickModal
说明: 是否可通过点击遮罩关闭弹框
类型: Boolean
默认值: true
参数: callback
说明: 若不使用 Promise,可以使用此参数指定弹框关闭后的回调
类型: (action, instance) => {}。action 的值为'confirm'或'cancel'; instance 为弹框实例,可以通过它访问实例上的属性和方法
默认值: undefined
举例:callback: (action, instance) => {
             console.log(action);
             console.log(instance);
           }
参数: beforeClose
说明: 弹框关闭前的回调,会暂停实例的关闭
类型:  (action, instance, done) => {}。action 的值为'confirm'或'cancel';instance 为弹框实例,可以通过它访问实例上的属性和方法;done 用于关闭 MessageBox 实例
默认值: undefined
举例: beforeClose: (action, instance, done) => {
              console.log(action);
              console.log(instance.title);
              done();
            }
参数: lockScroll
说明: 是否在弹框出现时将body滚动锁定
类型: Boolean
默认值: true
参数: showCancelButton
说明: 是否展示取消按钮
类型: Boolean
默认值: true
参数: showConfirmButton
说明: 是否展示确定按钮
类型: Boolean
默认值: true
参数: cancelButtonText
说明: 取消按钮文字
类型: String
默认值: '取消'
参数: confirmButtonText
说明: 确定按钮文字
类型: String
默认值: '确定'
参数: cancelButtonClass
说明: 取消按钮的自定义类名
类型: String
参数: confirmButtonClass
说明: 确定按钮的自定义类名
类型: String
参数: closeOnPressEscape
说明: 是否可通过按下 ESC 键关闭弹框
类型: Boolean
默认值: true