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

message_tips_chen

v1.1.0

Published

messageTips

Readme

参数 object || string

参数为object类型时

属性 | 类型 | 默认值 | 是否必填 | 说明 ---|---|---|---|--- mask | boolean | true | 否 | 控制背景层 showClose | boolean | false | 否 | 控制是否显示关闭按钮 title | string | | 否 | 标题 content | string 或 number | | 是 | 主题文案 confirmText | string | 确定 | 否 | 确定按钮文案 showCancel | boolean | false | 否 | 是否显示取消按钮 cancelText | string | 取消 | 否 | 取消按钮文案

参数为string类型时,即为content属性

复制组件引用

复制components/message文件加 main.js内引入 import '@/components/message';

npm包引用

<!--安装-->
yarn add message_tips_chen --save
<!--main.js内引用-->
import { $messageTips, $alert, $confirm } from 'message_tips_chen';
Vue.prototype.$messageTips = $messageTips;
Vue.prototype.$alert = $alert;
Vue.prototype.$confirm = $confirm;

应用举例

<!-- 参数为string类型  -->
const res = await this.$messageTips('消息文案').catch(e => e);
if (res === 'confirm') {
  console.log('click Confirm');
} else if (res === 'cancel') {
  console.log('click Cancel');
}

<!-- 参数为object类型  -->
const res = await this.$messageTips({
  mask: true,
  showClose: false,
  title: '',
  confirmText: '确定',
  cancelText: '取消',
  content: '消息文案',
  showCancel: false,
}).catch(e => e);
// 类型为confrim或者是cancel
if (res === 'confirm') {
  console.log('click Confirm');
} else if (res === 'cancel') {
  console.log('click Cancel');
}

其他命令调用

  1. this.$alert 等同于将showCancel设为false,参数类型和主体一致
  2. this.$comfirm 等同于将showCancel设为true,参数类型和主体一致