Merge branch 'hotfix/修复右键菜单的bug' into develop
Former-commit-id: 7b90a963676addf4d0b51593a4866f3e4a11ce60
This commit is contained in:
@@ -13,4 +13,8 @@
|
||||
|
||||
.el-menu--horizontal {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.el-tabs__item:focus.is-active.is-focus:not(:active) {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
watchContextmenu (event) {
|
||||
if (!this.$el.contains(event.target)) this.flag = false
|
||||
if (!this.$el.contains(event.target) || event.button !== 0) this.flag = false
|
||||
window.removeEventListener('mousedown', this.watchContextmenu)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -99,12 +99,16 @@ export default {
|
||||
*/
|
||||
handleContextmenu (event) {
|
||||
let target = event.target
|
||||
|
||||
// 解决 https://github.com/d2-projects/d2-admin/issues/54
|
||||
const attribute = target.getAttribute('aria-controls')
|
||||
if (attribute === null) {
|
||||
return
|
||||
let flag = false
|
||||
if (target.className.indexOf('el-tabs__item') > -1) flag = true
|
||||
else if (target.parentNode.className.indexOf('el-tabs__item') > -1) {
|
||||
target = target.parentNode
|
||||
flag = true
|
||||
}
|
||||
if (target.className.indexOf('el-tabs__item') > -1 || target.parentNode.className.indexOf('el-tabs__item') > -1) {
|
||||
|
||||
if (flag) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
this.contentmenuX = event.clientX
|
||||
|
||||
Reference in New Issue
Block a user