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 🙏

© 2024 – Pkg Stats / Ryan Hefner

stupid-dialog

v1.1.5

Published

A simple plugin for dialog with Vue

Downloads

25

Readme

stupid-dialog

一个简单的vue弹窗组件

组件: stupid-dialog

版本: 1.1.5

English document

使用方法

  • 通过NPM下载安装
	npm install stupid-dialog --save

通过import或者require在 main.js 中导入组件,在需要使用弹窗的页面调用方法

  • main.js
import Dialog from 'stupid-dialog';
Vue.prototype.$dialog = Dialog;
  • 某vue文件
this.$dialog('这是一个简单的小弹窗'); // 只传字符串时,默认弹窗类型为toast

this.$dialog({
	type: 'toast',
	message: '这是一个简单的小弹窗'
});

配置参数

| 参数 | 说明 | 类型 | 默认值 | | -------- | :----- | :-----: | :----: | | type | 弹窗类型(可选:toast/alert/confirm) | String | 'toast' | | message | 弹窗内容(必传值) | String | - | | title | 弹窗的标题(type=alert/confirm) | String | - | | position | 弹窗位置 | String/Number | 'center' | | duration | toast持续时间 | Number | 1500 | | mask | 是否有背景蒙板 | Boolean | true | | dark | 暗黑配色 | Boolean | false | | closeOnMask | 是否可点击蒙板关闭弹窗(type=alert/confirm) | Boolean | true | | preventScroll | 弹窗出现时是否阻止背景滑动 | Boolean | true | | dialogClass | 自定义class | String | - | | confirmText | 确定按钮文本 | String | '确定' | | cancelText | 取消按钮文本 | String | '取消' | | confirmFn | 点击’确定‘后回调(type=alert/confirm) | Function | - | | cancelFn | 点击’取消‘后回调(type=confirm) | Function | - | | beforeClose | 弹窗关闭前的回调(all types) | Function | - | 注:1、position值为String时可选值:top/center/bottom,为Number时可能值n:n>=0时距离顶部npx,n<0时距离底部-npx

组件样式粗糙,没有样式配置,有样式需求请根据class覆盖样式

| class | 说明 | | ----- | :--- | | dialog-content-mask | 蒙板 | | dialog-confirm | alert/confirm | | dialog-title | 标题 | | dialog-message | 内容 | | dialog-action | 操作 | | action-cancel | 取消按钮 | | action-confirm | 确定按钮 | | dialog-toast | toast |