We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
感谢你的工作,但我发现有一点小问题,注意下方你的源码:你根据右键事件的clientX和clientY来直接设置menu的style的left和top,但是在一些布局中仅仅设置left和top根本无效,于是menu自始至终都会在文档流中的位置(而不是根据右键点击的位置改变)
// 右键事件事件处理 contextMenuHandler (e) { this.x = e.clientX this.y = e.clientY this.layout() this.$emit('update:show', true) e.preventDefault() }, // 布局 layout () { this.style = { left: this.x + 'px', top: this.y + 'px' } }
我加了一个position: absolute;,解决了我这边的问题,但不知道在别的布局方式中会不会有偏移。
position: absolute;
The text was updated successfully, but these errors were encountered:
好的,谢谢你的反馈,我会测试下不同的布局方式
Sorry, something went wrong.
@binggg 我知道了,你的demo能work的原因在于你给组件加了一个.right-menu的class, 其中有position: fixed,或许可以把这个直接加到源码里面去。
.right-menu
position: fixed
.right-menu { position: fixed; background: #fff; border: solid 1px rgba(0, 0, 0, .2); border-radius: 3px; z-index: 999; display: none; }
No branches or pull requests
感谢你的工作,但我发现有一点小问题,注意下方你的源码:你根据右键事件的clientX和clientY来直接设置menu的style的left和top,但是在一些布局中仅仅设置left和top根本无效,于是menu自始至终都会在文档流中的位置(而不是根据右键点击的位置改变)
我加了一个
position: absolute;
,解决了我这边的问题,但不知道在别的布局方式中会不会有偏移。The text was updated successfully, but these errors were encountered: