v-contextmenu
v-contextmenu copied to clipboard
contextmenu位置是相对于body定位的,页面滚动时与原位置脱离
期望结果
contextmenu位置可选择相对于某个container定位,避免出现滚动后出现脱离的情况
实际结果
滚动后出现脱离原位置的情况
将 .v-contextmenu 设为 fixed 是否满足你的需要?
脱离某个 container 是在滚动元素不是 body 的时候发生的吗?
https://ant.design/components/dropdown-cn/#API
类似antd中dropdown组件提供的getPopupContainer方法。
就是这个右键菜单相对某一块区域定位
you can listen to scroll event and change the wrapper top and left. However, it is better to support that.
window.addEventListener('scroll', this.hideContextMenu, true)
I do this for lazy.....