Browse Source
fix: contextmenu location not right when body with scroll (#3516)
Co-authored-by: quanbisen <bisen_quan@lebo.cn>
pull/3518/head
superlollipop
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/components/ContextMenu/src/createContextMenu.ts
|
|
|
@ -34,7 +34,7 @@ export const createContextMenu = function (options: CreateContextOptions) { |
|
|
|
|
|
|
|
if (options.event) { |
|
|
|
propsData.customEvent = event; |
|
|
|
propsData.axis = { x: event.clientX, y: event.clientY }; |
|
|
|
propsData.axis = { x: event.clientX, y: event.clientY + body.scrollTop }; // y坐标需加上body往上滚动的Y
|
|
|
|
} |
|
|
|
|
|
|
|
const vm = createVNode(contextMenuVue, propsData); |
|
|
|
|