当前位置:网站首页>[example] v-contextmenu right click menu component
[example] v-contextmenu right click menu component
2022-07-24 09:29:00 【viceen】
【 example 】v-contextmenu Right click menu components
effect

Security package
cnpm i v-contextmenu -S
main.js
import contentmenu from 'v-contextmenu'
import 'v-contextmenu/dist/index.css'
Vue.use(contentmenu)
Submenu.vue
<template>
<div class="example">
<v-contextmenu ref="contextmenu" :theme="theme">
<v-contextmenu-item @click="handleClick"> menu 1</v-contextmenu-item>
<v-contextmenu-item @click="handleClick"> menu 2</v-contextmenu-item>
<v-contextmenu-item divider></v-contextmenu-item>
<v-contextmenu-submenu @submenu-show="handleSubmenuShow" title=" Sub menu ">
<v-contextmenu-item @click="handleClick"> menu 3</v-contextmenu-item>
<v-contextmenu-item divider></v-contextmenu-item>
<v-contextmenu-submenu title=" Sub menu ">
<v-contextmenu-item @click="handleClick"> menu 5</v-contextmenu-item>
</v-contextmenu-submenu>
<v-contextmenu-item @click="handleClick"> menu 4</v-contextmenu-item>
<v-contextmenu-item :auto-hide="false"> Don't turn off automatically 1</v-contextmenu-item>
<v-contextmenu-item :auto-hide="false"> Don't turn off automatically 2</v-contextmenu-item>
</v-contextmenu-submenu>
</v-contextmenu>
<div :class="['box', theme]" v-contextmenu:contextmenu>
Right click this area
</div>
</div>
</template>
<script>
export default {
name: 'Submenu',
props: {
theme: String,
},
methods: {
handleClick (vm, event) {
console.log(vm, event)
},
handleSubmenuShow (vm, placement) {
console.log(vm, placement)
},
},
}
</script>
<style scoped>
.box {
width: 100%;
}
</style>
边栏推荐
- Li Kou 300 longest increasing subsequence dynamic programming
- Getting started with sorting - insert sorting and Hill sorting
- Aruba学习笔记06-无线控制AC基础配置(CLI)
- [don't bother to strengthen learning] video notes (II) 1. What is Q-learning?
- Cess test online line! The first decentralized storage network to provide multiple application scenarios
- Common evaluation indexes of medical image segmentation
- How should tiktok shop cooperate with live broadcast in the background?
- Vector control of permanent magnet synchronous motor (I) -- mathematical model
- Makefile变量及动态库静态库
- What is the component customization event we are talking about?
猜你喜欢
![[don't bother with reinforcement learning] video notes (I) 3. Why use reinforcement learning?](/img/57/0ebff0839d2a2898472d3270fd13df.png)
[don't bother with reinforcement learning] video notes (I) 3. Why use reinforcement learning?

科目1-3

Li Kou 300 longest increasing subsequence dynamic programming

How to judge and analyze NFT market briefly through NFT go?

FreeRTOS - use of software timer

Nuxt 路由切换后 asyncData 跨域报错

DP longest common subsequence detailed version (LCS)

C#/VB. Net: convert word or EXCEL documents to text

JS locate Daquan to get the brother, parent and child elements of the node, including robot instances

web安全入门-开源防火墙Pfsense安装配置
随机推荐
Replace the function of pow with two-dimensional array (solve the time overrun caused by POW)
Vscode failed to use SSH Remote Connection (and a collection of other problems)
UE5影视动画渲染MRQ分层学习笔记
【基于ROS的URDF练习实例】四轮机器人与摄像头的使用
Assignment operator (geritilent software - Jiuye training)
How do tiktok merchants bind the accounts of talents?
Android Version Description security privacy 13
Account 1-2
Leetcode skimming: dynamic planning 03 (climb stairs with minimum cost)
[Luogu p5829] [template] mismatch tree (string) (KMP)
[note] what is kernel / user space? Let's start with how the CPU runs the program
Gin framework uses session and redis to realize distributed session & Gorm operation mysql
Asyncdata cross domain error after nuxt route switching
详解LinkedList
DSP development, using CCS software to establish engineering and burning
Introduction to common ansible modules
Why is TCP a triple handshake
Nuxt 路由切换后 asyncData 跨域报错
SQL 优化原则
JS locate Daquan to get the brother, parent and child elements of the node, including robot instances