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

nw-vue-toast

v0.4.4

Published

toast plugin for vue

Downloads

19

Readme

nw-vue-toast

English

又一个vue的提示插件

如何使用

使用包管理下载安装

$ npm install --S nw-vue-toast

使用模块管理引用

import ToastPlugin from 'nw-vue-toast'
Vue.use(ToastPlugin[, options]) // options here will apply to all toasts

在组件中使用

this.$toast('Test-Toast'[, options]}) // options here will apply to only this toast

可用的选项

| 名称 | 描述 | 类型 | 默认值 | | - | - | - | - | | position | 提示框的位置[1] | String | 'bottom center' | | content | 提示的内容,可以使用HTML | String | 'toast' | | time | 提示的持续时间,单位:毫秒(ms) | Integer | 3000 | | showAnimation | 提示出现时的动画效果[2] | String | 'fade-in' | | removeAnimation | 提示消失时的动画效果[3] | String | 'fade-out' | | customCss | 用户自定义的css[4], 形式为JavaScript对象 | Object | null | | customClass | 将会赋予提示栏的class[5] | String | "" | | afterRemoved | 在提示消失后进行回调 | Function | null |

[1] 内置的位置包括['top', 'bottom', 'middle']之一加上['left', 'center', 'right']之一, 例如. 'top center'. 也可以传入空字符串然后在customCss中进行具体设置。 [2][3] 内置的进入动画包括['fade-in', 'fly-in-left', 'fly-in-right', 'fly-in-top', 'fly-in-bottom']; 内置的离场动画包括['fade-out', 'fly-out-left', 'fly-out-right', 'fly-out-top', 'fly-out-bottom'] [4] 例如 {'background-color': 'black', 'color': 'white'} [5] 例如 "toast-class1 toast-class2"

方法

toast = this.$toast('Test-Toast')
toast.shake(n)  //提示框将会在一秒内抖动n次,默认值为40
toast.cancelTimeout() //取消自动的消失计时
toast.setNewTime(n) //新建消失计时,单位为毫秒(ms)
toast.remove() //提示会立刻以创建时选择的离场方式关闭
toast.setContent(str) //改变提示的内容

运行demo


# 安装依赖
$ npm install

# 运行demo
$ npm start
// visit localhost:8080 to see demo