CyberNika / v-contextmenu

🖱 ContextMenu based on Vue 3 & Vue 2
https://cybernika.github.io/v-contextmenu/
MIT License
918 stars 112 forks source link

指令操作显示后能否支持点击其他区域隐藏而不需要手动调用隐藏 #102

Open phpjishu opened 3 years ago

phpjishu commented 3 years ago

期望结果

使用指令显示菜单后,点击任意区域自动隐藏菜单

实际结果

使用指令显示菜单后无法,点击其他区域不隐藏

复现步骤

环境说明

CyberNika commented 3 years ago

方便给个可以复现的代码吗?看 https://heynext.xyz/v-contextmenu/ 里是正常的吧

lancertea commented 2 years ago

我也出现了类似情况

xx2hh commented 2 years ago

有大佬解决嘛?

yuxienanshan commented 11 months ago

自定义指令clickoutside里执行可以隐藏 Object.keys(window.$$VContextmenu).forEach((key) => { window.$$VContextmenu[key].hide(); });,可以隐藏,但是使用$refs.contextmenu.hide()不起效果