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

@charyliu/pack-vue

v1.0.1

Published

**此包提供了一些vue组件:** - Popup(弹窗组件)

Downloads

4

Readme

包说明

此包提供了一些vue组件:

  • Popup(弹窗组件)

维护: github

Install

npm install @charyliu/pack-vue

Usage

import {
  Popup, showPop, hidePop
} from '@charyliu/pack-vue'

Popup组件说明

Popup.props

| 属性 | 类型 | 必填 | 默认 | 描述 | |----------------|--------------|------|---------|--------------| | isCenter | boolean | false | true | 弹窗是否居中显示 | | maskOpacity | number | false | 0.7 | 弹窗蒙层(黑色)透明度 | | clickMaskHide | boolean | false | false | 点击弹窗蒙层关闭弹窗 | | maskClickThrough | boolean | false | false | 弹窗蒙层是否点击穿透 | | contentClassName | string | false | '' | 弹窗内容样式类名 |

showPop

/** 弹窗配置 */
interface PopOptions {
    /** 弹窗层级(打开高层级弹窗将自动隐藏低层级弹窗,关闭高层级弹窗后低层级弹窗将自动显示),默认0 */
    zIndex?: number;
    /** 弹窗是否居中显示,默认true */
    isCenter?: boolean;
    /** 弹窗蒙层(黑色)透明度, 默认0.7 */
    maskOpacity?: number;
    /** 点击弹窗蒙层关闭弹窗,默认false */
    clickMaskHide?: boolean;
    /** 点击弹窗蒙层回调 */
    onClickMask?: Function;
    /** 弹窗蒙层是否点击穿透, 默认false */
    maskClickThrough?: boolean;
    /** 弹窗内容样式类名 */
    contentClassName?: string;
    /** 自定义传入参数,会注入到弹出组件的props */
    [keyName: string]: any;
}
/**
 * 展示弹窗
 * @param popComp 弹窗组件
 * @param options 弹窗配置
 * @returns 弹窗id
 */
declare const showPop: (popComp: Vue.Component, options?: PopOptions) => string;

hidePop

/**
 * 隐藏弹窗
 * @param options 弹窗关闭配置
 */
declare function hidePop(options?: {
    /** 关闭全部 */
    isHideAll?: boolean;
    /** 要隐藏的弹窗的id,未传默认隐藏最上层弹窗 */
    id?: string;
    /** 弹窗内容样式类名 */
    contentClassName?: string;
    /** 延迟关闭弹窗的时间(ms),默认0 */
    delay?: number;
}): void;

使用示范

  • App.vue引入Popup组件
<script setup>
import { Popup } from '@charyliu/pack-vue'
import Index from 'index.vue'
</script>

<template>
  <div style="position: absolute; width: 100%; height: 100%">
    <Popup/>
    <Index></Index>
  </div>
</template>

<style scoped></style>
  • 其它组件(如index.vue)使用showPop/hidePop显隐弹窗
<script setup>
import { showPop, hidePop } from '@charyliu/pack-vue'
import Rank from 'rank.vue'
// 打开排行榜弹窗
const showRank = () => {
  showPop(Rank);
  setTimeout(() => {
    // 隐藏排行榜弹窗
    hidePop(Rank);
  }, 2000);
};
</script>

<template>
  <div style="position: absolute; width: 100%; height: 100%;">
    <Popup />
    <button @click="showRank">showRank</button>
  </div>
</template>

<style scoped></style>