
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
v-contextmenus
Advanced tools
右键菜单功能
yarn add v-contextmenus
请先确保你有使用 vuex
{
state: {
contextmenus: {
// 状态
show: true
// 数据
data: {},
// 事件
evt: null
}
},
mutaions: {
// 设置方法
setContextmenu (state, data) {
if (Object.keys(data).length > 1) {
state.contextmenu = data
} else {
state.contextmenu.show = data.show
}
}
}
}
<template>
<main>
<!-- 绑定事件 -->
<div @contextmenu.prevent="rightClick"></div>
<!-- 引用 -->
<VContextmenus></VContextmenus>
</main>
</template>
<script>
// 引入 store
import store from '../assets/js/store'
// 引入
import VContextmenus from '../components/VContextmenus'
export default {
components: {
VContextmenus
},
data () {
return {
// 菜单内容
menu: [ ... ]
}
},
methods: {
// 自定义事件
rightClick (evt) {
store.commit('setContextmenu', {
data: this.menu, evt
})
}
}
}
</script>
@data 菜单内容 @evt 鼠标事件
展示菜单功能
将 demo 文件放到你的 vue webpack 项目中,替换其下的 src
FAQs
Vue 右键菜单功能
The npm package v-contextmenus receives a total of 0 weekly downloads. As such, v-contextmenus popularity was classified as not popular.
We found that v-contextmenus 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.