Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
iview-contextmenu
Advanced tools
A contextmenu component depend on iview-dropdown component.
Engilsh | 中文
Using npm:
npm install iview-contextmenu
main.js:
import Vue from 'vue'
import iView from 'iview'
import Contextmenu from 'iview-contextmenu'
import 'iview/dist/styles/iview.css'
import 'iview-contextmenu/dist/iview-contextmenu.css'
Vue.use(iView)
Vue.use(Contextmenu)
App.vue:
<template>
<div
id="app"
@contextmenu.prevent="preventContextmenu"
>
<!-- It will respond to document contextmenu event when no set trigger = 'custom' -->
<Contextmenu
:menu-data="menuData"
@on-select="handleSelect"
@on-cancel="handleCancel"
></Contextmenu>
</div>
</template>
<script>
export default {
name: 'App',
data () {
return {
menuData: [
{
title: 'Menu1',
name: 'menu1'
},
{
title: 'Menu2',
name: 'menu2',
shortcut: 'Ctrl+J'
},
{
title: 'Menu3',
name: 'menu3',
divided: true,
disabled: true
}
]
}
},
methods: {
handleSelect (name) {
console.log(`select contextmenu: ${name}`)
},
handleCancel () {
console.log('cancel contextmenu')
},
preventContextmenu () {
return false
}
}
}
</script>
<style>
* {
box-sizing: border-box;
}
html, body {
height: 100%;
}
body {
overflow: hidden;
}
#app {
height: 100%;
}
</style>
Property | Desciption | Type | Default |
---|---|---|---|
menu-data | An Array that generates the contextmenu. | Array | - |
trigger | Set to 'custom' to control visible manually. | String | '' |
visible | Control the display of Contextmenu manually, used when trigger = 'custom' . | Boolean | false |
Event Name | Description | Return Value |
---|---|---|
on-select | Emit when clicking the contextmenu item, the return value will be 'parentName-childName' when clicking the child menu. | ContextmenuItem's prefixName |
on-cancel | Triggered when click the outside body. | - |
Key | Description | Type | Default |
---|---|---|---|
title | Item's title. | String | - |
name | Used to tag the item. | String | - |
visible | Used to hidden the item. | Boolean | true |
divided | Show spilt line. | Boolean | false |
desabled | Used to disable the item. | Boolean | false |
icon | Right icon Type, it will be ignored when item has children. | String | - |
shortcut | Right text content, it wiil be ignored when right icon is set or item has children. | String | - |
children | The son item | Array | - |
prefix | Prefix the children name when to select item's children, default used name value when no set | String | - |
Copyright (c) 2019-present, iview-contextmenu
FAQs
A contextmenu component depend on iview-dropdown component
The npm package iview-contextmenu receives a total of 0 weekly downloads. As such, iview-contextmenu popularity was classified as not popular.
We found that iview-contextmenu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.