@contextmenu
时间: 2023-08-28 16:14:50 浏览: 55
@contextmenu是Vue框架的一个指令,用于绑定右键点击事件。在引用的代码中,使用@contextmenu.prevent="onContextMenu"为一个容器元素绑定了右键点击事件。当用户在该容器上右键点击时,会触发onContextMenu方法。该方法会根据点击的位置(clientX和clientY)来设置ContextMenu的显示位置和配置,并将contextShow属性设置为true,从而显示ContextMenu组件。所以,@contextmenu.prevent="onContextMenu"实际上是用来触发ContextMenu的显示。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [vue 右键菜单contextMenu](https://blog.csdn.net/qq_42785284/article/details/114364307)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *2* *3* [ContextMenu的使用](https://blog.csdn.net/qiutiandepaomo/article/details/78114353)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
<el-checkbox-group v-model="queueName50" style="margin: 10px;"> <el-checkbox v-for="item in queueNameList[server50]" :key="item.nameWithIp" :label="item.name" :disabled="!enableZeroCountQueue && item.enqueueCountDiff === 0" style="color: white;width: 290px;"> {{ item.label }} </el-checkbox> </el-checkbox-group>在这个组件里,我用@click.prevent 阻止了点击事件,现在我只想阻止点击后触发的openLink,而不想阻止这个组件本身的选中功能,应该怎么改代码
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)