Skip to content

Commit

Permalink
fix: 二级菜单显示问题 #158
Browse files Browse the repository at this point in the history
  • Loading branch information
v_yutyi authored and EmilyMei committed Dec 28, 2021
1 parent e9f92d8 commit f07d143
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/src/views/organization/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1274,13 +1274,14 @@ export default {
this.$set(item, 'showBackground', true);
this.$nextTick(() => {
const calculateDistance = this.calculate(event.target);
const differ = document.querySelector('body').offsetHeight - calculateDistance.getOffsetTop;
const next = event.target.nextElementSibling;
next.style.left = `${calculateDistance.getOffsetLeft + 20}px`;
next.style.top = `${calculateDistance.getOffsetTop + 30}px`;
if (differ <= 178) {
next.style.top = 'auto';
next.style.bottom = `${differ + 7}px`;
const bottomHeight = window.innerHeight - (next.offsetTop - window.pageYOffset) - next.offsetHeight;
if ((bottomHeight < 0) && (next.offsetHeight === 146)) {
next.style.top = `${calculateDistance.getOffsetTop - next.offsetHeight - 8}px`;
} else if ((bottomHeight < 0) && (next.offsetHeight === 254)) {
next.style.top = `${calculateDistance.getOffsetTop - next.offsetHeight - 8}px`;
}
});
},
Expand Down

0 comments on commit f07d143

Please sign in to comment.