Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-contextmenus

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-contextmenus

vue版本通用右健菜单组件,用过的都说好,没用的都在找。

  • 0.1.26
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

vue-contentmenus

##效果图

fHu2qI.gif

##实现功能

1、右健菜单
2、多级菜单
3、可放置到任意元素之上
4、支持弹出层消失方式 mouseleave | click
5、弹出层按窗口大小自动适应位置
6、动态设置show内容来控制菜单内容的显示与隐藏

安装组件

npm i vue-contextmeuns

组件引入、初始化

import ContextMenu from "vue-contextmenus";
import "vue-contextmenus/lib/vue-contextmenus.css";

@Component({
  components: {
    ContextMenu
  },
})

##使用方法

example.vue

//全局监听右健事件
<template>
  <ContextMenu :options="options" hidingMode="click">
    <div id="app">
      <img alt="Vue logo" src="./assets/logo.png">
    </div>
  </ContextMenu>
</template>

//只监听IMG图片的右健事件
<template>
  <div id="app">
  	<ContextMenu :options="options" hidingMode="click">
      <img alt="Vue logo" src="./assets/logo.png">
  	</ContextMenu>
  </div>
</template>

数据:
options = [
    {'type':'title', 'title':'基本操作'},
    {'type':"line"},
    {'title':'复制','icon':'el-icon-copy-document',show:true,callback:()=>{
      console.log( 'res' )
    }}
]

icon: 图标,该属性为图标class,如:elementUI的删除 -> el-icon-delete
type: 类型, title=>标题类型 | line => 横线
title: 标题名称
show: 是否显示,可动态设置
callback: 菜单点击点的回调事件


Prop:
options => 接收options的值
hidingMode => 弹出框消失方式   mouseleave | click, 默认为 mouseleave 方式

Customize configuration

See Configuration Reference.

Keywords

FAQs

Package last updated on 17 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc