chenrui пре 4 година
родитељ
комит
b7d60a0653
2 измењених фајлова са 8 додато и 7 уклоњено
  1. 3 3
      src/config/defaultSettings.js
  2. 5 4
      src/layouts/RouteView.vue

+ 3 - 3
src/config/defaultSettings.js

@@ -17,12 +17,12 @@ export default {
   primaryColor: '#ff0000', // primary color of ant design
   navTheme: 'dark', // theme for nav menu
   layout: 'sidemenu', // nav menu position: sidemenu or topmenu
-  contentWidth: 'Fluid', // layout of content: Fluid or Fixed, only works when layout is topmenu
-  fixedHeader: true, // sticky header
+  contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu
+  fixedHeader: false, // sticky header
   fixSiderbar: false, // sticky siderbar
   autoHideHeader: false, //  auto hide header
   colorWeak: false,
-  multiTab: true,
+  multiTab: false,
   production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true',
   // vue-ls options
   storageOptions: {

+ 5 - 4
src/layouts/RouteView.vue

@@ -23,10 +23,11 @@ export default {
     // 这里增加了 multiTab 的判断,当开启了 multiTab 时
     // 应当全部组件皆缓存,否则会导致切换页面后页面还原成原始状态
     // 若确实不需要,可改为 return meta.keepAlive ? inKeep : notKeep
-    if (!getters.multiTab && !meta.keepAlive) {
-      return notKeep
-    }
-    return this.keepAlive || getters.multiTab || meta.keepAlive ? inKeep : notKeep
+    // if (!getters.multiTab && !meta.keepAlive) {
+    //   return notKeep
+    // }
+    // return this.keepAlive || getters.multiTab || meta.keepAlive ? inKeep : notKeep
+    return meta.keepAlive ? inKeep : notKeep
   }
 }
 </script>