perf: 手机端消息菜单居中

This commit is contained in:
kuaifan 2024-09-19 06:47:16 +08:00
parent 9251ccbb12
commit 594c19da03

View File

@ -2874,12 +2874,13 @@ export default {
if (rect.bottom > scrollerRect.bottom) { if (rect.bottom > scrollerRect.bottom) {
height -= rect.bottom - scrollerRect.bottom height -= rect.bottom - scrollerRect.bottom
} }
const left = this.windowWidth < 500 ? (this.windowWidth / 2) : event.clientX
this.operateStyles = { this.operateStyles = {
left: `${event.clientX}px`, left: `${left}px`,
top: `${top}px`, top: `${top}px`,
height: `${height}px`, height: `${height}px`,
} }
this.operateClient = {x: event.clientX, y: event.clientY}; this.operateClient = {x: left, y: event.clientY};
this.operateVisible = true; this.operateVisible = true;
}) })
}, },