修复完成版对应的issue54,55,56

Former-commit-id: 74894882e9a2b12917de159b0be4af84c9604eda
This commit is contained in:
Lu Chaohai
2018-08-04 18:34:24 +08:00
parent 3ab1c417d0
commit 2efa1849a4
3 changed files with 13 additions and 5 deletions
+4
View File
@@ -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