有可能是事件冒泡了,在菜单点击事件使用e.stoppropagation()试试
阻止一下右键的默认点击事件window.oncontextmenu = function (e) {// 阻止默认行为e.preventDefault()console.log('右键单击了')}试一试