mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-07 13:18:16 +00:00
perf: 优化长按菜单位置
This commit is contained in:
parent
54a42a14b6
commit
77940c9430
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="page-manage" :class="pageClass">
|
||||
<div class="manage-box-menu">
|
||||
<div ref="boxMenu" class="manage-box-menu">
|
||||
<Dropdown
|
||||
class="page-manage-menu-dropdown main-menu"
|
||||
trigger="click"
|
||||
@ -1143,9 +1143,10 @@ export default {
|
||||
this.operateItem = $A.isJson(projectItem) ? projectItem : {};
|
||||
this.$nextTick(() => {
|
||||
const rect = el.getBoundingClientRect();
|
||||
const parentRect = this.$refs.boxMenu?.getBoundingClientRect() || {top: 0, left: 0}
|
||||
this.operateStyles = {
|
||||
left: `${event.clientX}px`,
|
||||
top: `${rect.top + this.windowScrollY}px`,
|
||||
left: `${event.clientX - parentRect.left}px`,
|
||||
top: `${rect.top + this.windowScrollY - parentRect.top}px`,
|
||||
height: rect.height + 'px',
|
||||
}
|
||||
this.operateVisible = true;
|
||||
|
||||
@ -183,9 +183,10 @@ export default {
|
||||
this.operateItem = $A.isJson(projectItem) ? projectItem : {};
|
||||
this.$nextTick(() => {
|
||||
const rect = el.getBoundingClientRect();
|
||||
const parentRect = this.$el.getBoundingClientRect() || {top: 0, left: 0}
|
||||
this.operateStyles = {
|
||||
left: `${event.clientX}px`,
|
||||
top: `${rect.top + this.windowScrollY}px`,
|
||||
left: `${event.clientX - parentRect.left}px`,
|
||||
top: `${rect.top + this.windowScrollY - parentRect.top}px`,
|
||||
height: rect.height + 'px',
|
||||
}
|
||||
this.operateVisible = true;
|
||||
|
||||
@ -1060,9 +1060,10 @@ export default {
|
||||
this.operateVisible = false;
|
||||
this.operateItem = $A.isJson(item) ? item : {};
|
||||
this.$nextTick(() => {
|
||||
const parentRect = this.$refs.list?.$el?.getBoundingClientRect() || {top: 0, left: 0}
|
||||
this.operateStyles = {
|
||||
left: `${clientX}px`,
|
||||
top: `${rect.top + this.windowScrollY}px`,
|
||||
left: `${clientX - parentRect.left}px`,
|
||||
top: `${rect.top + this.windowScrollY - parentRect.top}px`,
|
||||
height: rect.height + 'px',
|
||||
}
|
||||
this.operateVisible = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user