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 🙏

© 2025 – Pkg Stats / Ryan Hefner

happy-vue-toast

v0.0.2

Published

a toast plugin for vue2

Downloads

5

Readme

happy-vue-toast

一款基于vue2的toast插件

安装

// 安装
npm install happy-vue-toast

// 引入注册
import toast from 'happy-vue-toast'
Vue.use(toast)

// 全局注册时可以加入配置项
Vue.use(toast,{
    type:'bottom'
    //....
})

你也下载 dist中的happy-vue-toast.js文件,直接引入使用

// 注意前提是引入了vue文件
<script src="./dist/happy-vue-toast.js"></script>

基本使用

toast 显示的位置有 topcenterbottom 三种

// 默认在页面中间显示
this.$toast('hello world')

// 修改为在top显示
this.$toast('hello world','top')
// or 
this.$toast.top('hello world')
this.$toast.center('hello world')
this.$toast.bottom('hello world')

// 局部调用加入配置项,此配置项会覆盖全局配置项
this.$toast.top('hello world',{
    duration:3000, // 持续时间
    extStyle:{  // 修改样式
        color:'red',
        background: '#eeeeee'
    }
})

使用loading功能

// 不加配置使用默认样式
this.$showLoading()

// 可自行配置所需样式
this.$showLoading({
    donutColor:'red' // 加载动画环的颜色
    //...
})

// 关闭加载
this.$hideLoading()

配置项

toast的配置项

|名称|类型|作用| |:------:|:------:|:------:| |type|string|控制显示位置| |duration|number|显示持续时间| |extStyle|object|修改样式(不建议修改很多)|

loading的配置项

|名称|类型|作用| |:------:|:------:|:------:| |loadText|string|显示字样| |showMask|boolean|是否显示遮罩层| |maskColor|string|遮罩层颜色| |donutColor|string|加载动画环的颜色| |loadBgColor|string|加载显示块的背景色|

期望

  1. 加入不同加载动画
  2. ...