mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-04 04:08:16 +00:00
fix: 消息太长导致菜单无法正常显示
This commit is contained in:
parent
6218521dea
commit
3596475790
@ -2748,10 +2748,20 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const rect = el.getBoundingClientRect();
|
const rect = el.getBoundingClientRect();
|
||||||
|
const scrollerRect = this.$refs.scroller.$el.getBoundingClientRect();
|
||||||
|
let top = rect.top + this.windowScrollY,
|
||||||
|
height = rect.height;
|
||||||
|
if (rect.top < scrollerRect.top) {
|
||||||
|
top = scrollerRect.top
|
||||||
|
height -= scrollerRect.top - rect.top
|
||||||
|
}
|
||||||
|
if (rect.bottom > scrollerRect.bottom) {
|
||||||
|
height -= rect.bottom - scrollerRect.bottom
|
||||||
|
}
|
||||||
this.operateStyles = {
|
this.operateStyles = {
|
||||||
left: `${event.clientX}px`,
|
left: `${event.clientX}px`,
|
||||||
top: `${rect.top + this.windowScrollY}px`,
|
top: `${top}px`,
|
||||||
height: rect.height + 'px',
|
height: `${height}px`,
|
||||||
}
|
}
|
||||||
this.operateClient = {x: event.clientX, y: event.clientY};
|
this.operateClient = {x: event.clientX, y: event.clientY};
|
||||||
this.operateVisible = true;
|
this.operateVisible = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user