当前位置:网站首页>[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>
边栏推荐
- Leetcode skimming: dynamic planning 03 (climb stairs with minimum cost)
- What is the component customization event we are talking about?
- 科目1-3
- 排序入门—插入排序和希尔排序
- What are the 6% annualized products?
- Why is TCP a triple handshake
- Little dolphin "transformed" into a new intelligent scheduling engine, which can be explained in simple terms in the practical development and application of DDS
- From single architecture to distributed architecture, there are many pits and bugs!
- TT ecosystem - cross border in-depth selection
- Firewall off and on command
猜你喜欢

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

Leetcode skimming: dynamic planning 03 (climb stairs with minimum cost)

Aruba学习笔记06-无线控制AC基础配置(CLI)
![[example of URDF exercise based on ROS] use of four wheeled robot and camera](/img/c5/babce5c6921b9cb54f018dc83a3b87.jpg)
[example of URDF exercise based on ROS] use of four wheeled robot and camera

The difference between & &, | and |

web安全入门-开源防火墙Pfsense安装配置

Assignment operator (geritilent software - Jiuye training)

力扣300-最长递增子序列——动态规划
![[leetcode] 31. Next arrangement](/img/83/50a3cc17fc252582458bf32d1dd36b.png)
[leetcode] 31. Next arrangement

js定位大全获取节点的兄弟,父级,子级元素含robot实例
随机推荐
Gin framework uses session and redis to realize distributed session & Gorm operation mysql
财务数字化转型
Android Version Description security privacy 13
Makefile变量及动态库静态库
TT ecosystem - cross border in-depth selection
How to open the port number of the server, and the corresponding port of common network services
Tiflash source code reading (V) deltatree storage engine design and implementation analysis - Part 2
Detailed sequence traversal of leetcode102 binary tree
TCP triple handshake connection combing
Promise基础总结
Build practical product help documents to improve user satisfaction
Ue5 film and television animation rendering MRQ layered learning notes
[note] what is kernel / user space? Let's start with how the CPU runs the program
We were tossed all night by a Kong performance bug
详解LinkedList
How to improve office efficiency through online collaborative documents
Practice 4-6 number guessing game (15 points)
[assembly language practice] solve the unary quadratic equation ax2+bx+c=0 (including source code and process screenshots, parameters can be modified)
Cess test online line! The first decentralized storage network to provide multiple application scenarios
[don't bother to strengthen learning] video notes (III) 3. SARS (lambda)