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