调整不同屏幕下的兼容性

This commit is contained in:
蒋吉兆
2021-09-21 21:02:40 +08:00
parent 46442f4a65
commit 2f402fe26d
3 changed files with 9 additions and 5 deletions

View File

@@ -160,7 +160,7 @@ export default {
return this.$route.matched
}
},
mounted() {
created() {
const screenWidth = document.body.clientWidth
if (screenWidth < 1000) {
this.isMobile = true
@@ -175,6 +175,8 @@ export default {
this.isSider = true
this.isCollapse = false
}
},
mounted() {
emitter.emit('collapse', this.isCollapse)
emitter.emit('mobile', this.isMobile)
emitter.on('reload', this.reload)