修复页签栏右键菜单位置错误的问题

master
toesbieya 6 years ago
parent 3a29fba599
commit b75ce266cc
  1. 8
      vue/src/layout/component/Page/component/TagsView/index.vue

@ -146,11 +146,11 @@ export default {
e.preventDefault()
const contextMenuWidth = 105 //
const offsetWidth = this.$el.offsetWidth // container width
const maxLeft = offsetWidth - contextMenuWidth // left boundary
const left = e.clientX + 15 // 15: margin right
const {left: elLeft, width: elWidth} = this.$el.getBoundingClientRect()
const maxLeft = elWidth + elLeft - contextMenuWidth
const left = e.clientX
this.contextmenu.left = left > maxLeft ? maxLeft : left
this.contextmenu.left = (left > maxLeft ? maxLeft : left) + 15
this.contextmenu.top = e.clientY
this.contextmenu.show = true

Loading…
Cancel
Save