修复top栏样式问题
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user