Browse Source

当屏幕分辨率宽度低于1920时,自动折叠菜单

ZaiZai 2 years ago
parent
commit
ddc182243b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/App.vue

+ 5 - 0
src/App.vue

@@ -29,6 +29,11 @@ watch(() => [
 nextTick(() => {
     setUserTheme(appStore.getThemeVal, appStore.getColor)
     ulog('客户端 启动成功', '当前开发版本 v' + config?.version)
+    //当屏幕分辨率宽度低于1920时,自动折叠菜单
+    const width = document.body.clientWidth
+    if (width < 1920) {
+        appStore.setCollapse(true)
+    }
 })
 
 //设置主题