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

@k.iryna/vue3-context-menu

v1.4.3

Published

A context menu component for Vue3

Downloads

16

Readme

vue3-context-menu

一个使用 Vue3 制作的简洁美观简单的右键菜单组件

截图


特性

  • 简洁易用,体积小
  • 提供组件模式和函数模式,调用方便
  • 提供多个菜单主题供您使用
  • 可自定义

用法

npm install -save @imengyu/vue3-context-menu

然后在 main.ts 中导入:

import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css'
import ContextMenu from '@imengyu/vue3-context-menu'

createApp(App).use(ContextMenu)     

然后你就可以在 vue 文件中使用菜单了:

import ContextMenu from '@imengyu/vue3-context-menu'

onContextMenu(e : MouseEvent) {
  //prevent the browser's default menu
  e.preventDefault();
  //show your menu
  ContextMenu.showContextMenu({
    x: e.x,
    y: e.y,
    items: [
      { 
        label: "A menu item", 
        onClick: () => {
          alert("You click a menu item");
        }
      },
      { 
        label: "A submenu", 
        children: [
          { label: "Item1" },
          { label: "Item2" },
          { label: "Item3" },
        ]
      },
    ]
  }); 
}

关于详细的用法,请参考文档。

文档

查看文档

查看在线演示

开发

git clone [email protected]:imengyu/vue3-context-menu.git
cd vue3-context-menu
npm install
npm serve

已有主题

|theme|explain|example image| |--|--|--| |default|Default theme|example-default-dark.jpg| |default dark|Default theme with dark|example-default-dark.jpg| |flat|Simple flat theme|example-default-dark.jpg| |flat dark|Simple flat theme with dark|example-default-dark.jpg| |win10|Win10 like theme|example-default-dark.jpg| |win10 dark|Win10 like theme with dark|example-default-dark.jpg| |mac|Mac like theme|example-default-dark.jpg| |mac dark|Mac like theme with dark|example-default-dark.jpg|

License

MIT