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

@ektx/v-contextmenu

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ektx/v-contextmenu

Vue 右键菜单功能

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

VContextmenu

右键菜单功能

demo

安装

yarn add @ektx/v-contextmenu
npm i @ektx/v-contextmenu

NPM 使用

引用组件

import Vue from 'vue';
import VContextmenu from '@ektx/v-contextmenu';
import '@ektx/v-contextmenu/dist/vcontextmenu.css';

Vue.use(VContextmenu);

Vue 页面使用

<template>
	<!-- 绑定事件 -->
	<div @contextmenu.prevent="rightClick"></div>
</template>

<script>
	export default {
		name: 'demo',
		data () {
			return {
				// 菜单内容
				menu: [{
					title: 'v-contenxtmenus',
					classes: 'hello',
					evt (data) {
						alert('Welcome Use v-contenxtmenus!')
					}
				},
				{
					title: '联系方式',
					children: {
						title: 'ektx1989@gmail.com'
					},
					{
						title: '@宅龙猫'
					}]
				},
				{
					type: 'separator'
				},
				{
					title: 'Github.com',
					evt () {

					}
				},
				{
					type: 'separator'
				},
				{
					disabled: true,
					title: 'v 0.1.0'
				}]
			}
		},
		methods: {
			// 自定义事件
			rightClick (evt) {
				this.$VContextmenu.show(this.menu, evt)
			}
		}
	}
</script>

事件方法

/**
 * 显示功能
 * @param [Array] 菜单内容
 * @param [event] JS事件
 */
this.$VContextmenu.show(data, evt)

/**
 * 手动关闭功能
 */
this.$VContextmenu.close()

data 说明

标签类型说明默认值
titleString菜单列表标题-
evtFunction菜单点击事件-
disabledBoolean是否可以使用-
classesClass自定义样式名-
typeseparator分隔线-

FAQs

Package last updated on 11 Nov 2018

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