修复top栏样式问题

This commit is contained in:
QM303176530
2020-05-01 18:10:45 +08:00
parent 113d59fdf9
commit 7dd0512e67
3 changed files with 152 additions and 143 deletions
@@ -36,6 +36,7 @@ export default {
left: 0,
top: 0,
isCollapse: false,
isMobile:false,
rightActive: ''
}
},
@@ -53,9 +54,15 @@ export default {
this.setTab(this.$route)
},
mounted() {
this.$bus.on('totalCollapse', () => {
this.isCollapse = !this.isCollapse
this.$bus.on('collapse',(isCollapse)=>{
this.isCollapse = isCollapse
})
this.$bus.on('mobile'),(isMobile)=>{
this.isMobile = isMobile
}
},
beforeDestroy(){
this.$bus.off('collapse')
},
methods: {
openContextMenu(e) {
@@ -66,10 +73,13 @@ export default {
this.contextMenuVisible = true
let width
if (this.isCollapse) {
width = 60
width = 54
} else {
width = 220
}
if(this.isMobile){
width = 0
}
this.left = e.clientX - width
this.top = e.clientY + 10
this.rightActive = e.srcElement.id.split('-')[1]
+1 -4
View File
@@ -50,9 +50,7 @@ export default {
if(screenWidth<1000){
this.isCollapse = !this.isCollapse
}
this.$bus.on('totalCollapse', () => {
this.isCollapse = !this.isCollapse
})
this.$bus.on('collapse', (item) => {
this.isCollapse = item
})
@@ -64,7 +62,6 @@ export default {
}
},
beforeDestroy() {
this.$bus.off('totalCollapse')
this.$bus.off('collapse')
}
}