Commit bbbcf8e0 authored by 黄奎's avatar 黄奎

选项卡右键菜单修改

parent 0a66b416
......@@ -229,19 +229,34 @@
showRightMenu(e) {
if (e.button == 2) {
let id = ''
e.path.forEach(x => {
if (x.className && x.className.indexOf('el-tabs__item') != -1) {
id = x.id.split('-')[1]
return false
}
})
this.tabs.forEach((x, i) => {
if ((x.name + "_" + i) == id) {
this.mouseX = e.clientX
this.mouserY = e.offsetY
this.currentRightIndex = i
if (e.path) {
e.path.forEach(x => {
if (x.className && x.className.indexOf('el-tabs__item') != -1) {
id = x.id.split('-')[1]
return false
}
})
this.tabs.forEach((x, i) => {
if ((x.name + "_" + i) == id) {
this.mouseX = e.clientX
this.mouserY = e.offsetY
this.currentRightIndex = i
}
})
} else if (id == '' && e.target && e.target.id) {
var tempArray = e.target.id.split('-');
if (tempArray && tempArray.length > 1) {
id = tempArray[1];
}
})
this.tabs.forEach((x, i) => {
var newName = x.name + "_" + i;
if (newName == id) {
this.mouseX = e.clientX
this.mouserY = e.offsetY
this.currentRightIndex = i
}
})
}
}
},
goback(t) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment