Commit c2c977f6 by kokoroli

fix:MultiTab close methods

parent a9b9614c
...@@ -43,7 +43,6 @@ export default { ...@@ -43,7 +43,6 @@ export default {
}, },
methods: { methods: {
onEdit (targetKey, action) { onEdit (targetKey, action) {
console.log('onEdit', targetKey, action)
this[action](targetKey) this[action](targetKey)
}, },
remove (targetKey) { remove (targetKey) {
...@@ -60,30 +59,33 @@ export default { ...@@ -60,30 +59,33 @@ export default {
// content menu // content menu
closeThat (e) { closeThat (e) {
console.log('close that', e)
this.remove(e) this.remove(e)
}, },
closeLeft (e) { closeLeft (e) {
// TODO const currentIndex = this.fullPathList.indexOf(e)
console.log('close left', e) if (currentIndex > 0) {
const index = this.fullPathList.indexOf(e) this.fullPathList.forEach((item, index) => {
if (index > 0) { if (index < currentIndex) {
this.remove(this.fullPathList[index - 1]) this.remove(item)
}
})
} else { } else {
this.$message.info('左侧没有标签') this.$message.info('左侧没有标签')
} }
}, },
closeRight (e) { closeRight (e) {
console.log('close right', e) const currentIndex = this.fullPathList.indexOf(e)
const index = this.fullPathList.indexOf(e) if (currentIndex < (this.fullPathList.length - 1)) {
if (index < (this.fullPathList.length - 1)) { this.fullPathList.forEach((item, index) => {
this.remove(this.fullPathList[index + 1]) if (index > currentIndex) {
this.remove(item)
}
})
} else { } else {
this.$message.info('右侧没有标签') this.$message.info('右侧没有标签')
} }
}, },
closeAll (e) { closeAll (e) {
console.log('close all', e)
const currentIndex = this.fullPathList.indexOf(e) const currentIndex = this.fullPathList.indexOf(e)
this.fullPathList.forEach((item, index) => { this.fullPathList.forEach((item, index) => {
if (index !== currentIndex) { if (index !== currentIndex) {
...@@ -92,8 +94,6 @@ export default { ...@@ -92,8 +94,6 @@ export default {
}) })
}, },
closeMenuClick ({ key, item, domEvent }) { closeMenuClick ({ key, item, domEvent }) {
console.log('key', key)
console.log('item', item.$attrs['data-vkey'])
const vkey = domEvent.target.getAttribute('data-vkey') const vkey = domEvent.target.getAttribute('data-vkey')
switch (key) { switch (key) {
case 'close-right': case 'close-right':
...@@ -141,7 +141,6 @@ export default { ...@@ -141,7 +141,6 @@ export default {
} }
}, },
activeKey: function (newPathKey) { activeKey: function (newPathKey) {
console.log('activeKey', newPathKey)
this.$router.push({ path: newPathKey }) this.$router.push({ path: newPathKey })
} }
}, },
......
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