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-ui-modal

v1.0.7

Published

It is a tool using the vue building function that contain alert, confirm, prompt, loading

Readme

Installation

$ npm install vue-ui-modal --save

Usage

import utils from 'vue-ui-modal';

In your webpack configuration

module.exports = {
    // ...
    module: {
        rules: [{
            test: /\.vue$/,
            include: [
                // resolve('src'),
                path.resolve(__dirname, 'node_modules/vue-ui-modal')
            ],
            use: ['vue-loader']
        }],
    },
    // ...
}

Plugins(or Methods)

  • alert
  • confirm
  • prompt
  • toast
  • loading

alert example


import utils from 'vue-ui-modal';

/*
 *  utils.alert
 *  @param {String|Object} msg
 *  @return promise
 **/

// utils.alert('天亮了');
const promise = utils.alert({
    title: '提示标题',  // 非必填,默认为提示
    msg: '请确定',
    buttonText: 'Ok',
    hideTitle: false // 隐藏标题,默认false
});

promise.then(() => {
    utils.toast('你点ok了');
});

confirm example


import utils from 'vue-ui-modal';

/*
 *  utils.confirm
 *  @param {String|Object} msg
 *  @return promise
 **/

const promise = utils.confirm({
    title: '提示标题',  // 非必填,默认为提示
    msg: '你赞成他刚才所说的观点吗?',
    leftButtonText: '否定',
    rightButtonText: '赞成',
    hideTitle: false, // 隐藏标题,默认false
    callback: () => {} // 默认为空函数,返回false将不会销毁组件,返回promise,非resolve状态也不会销毁状态
});

promise
    .then(() => {
        utils.toast('你赞成了');
    })
    .catch(() => {
        utils.toast('你否定了');
    });

prompt example


import utils from 'vue-ui-modal';

/*
 *  utils.prompt
 *  @param {String|Object} msg
 *  @return promise
 **/

const promise = utils.prompt({
    title: '提示标题',  // 非必填,默认为提示
    msg: '谈谈你对最近的工作有啥感受?',
    leftButtonText: '忽略',
    rightButtonText: '提交',
    hideTitle: false // 隐藏标题,默认false
});

promise
    .then(answer => {
        utils.toast(`你的回答是:${answer}`);
    })
    .catch(() => {
        utils.toast('太狠了,再也不见');
    });

toast example


import utils from 'vue-ui-modal';

/*
 *  utils.toast
 *  @param {String|Object} msg
 *  @return vue object
 **/

// utils.toast('好消息');
const vm = utils.toast({
    msg: '号外号外!!',
    dismissTimeout: 2000,   // 组件销毁延时毫秒数,默认2000ms
    autoDismiss: true       // 自动销毁,默认true
});
// vm.destroy(); // 销毁vue组件

loading example


import utils from 'vue-ui-modal';

/*
 *  utils.loading
 *  @param {String} msg
 *  @return vue object
 **/

const vm = utils.loading('正在加载中...');
setTimeout(() => {
    vm.destroy();
    utils.toast('loading在5秒后销毁了');
}, 5000);