Blame view

ruoyi-ui/src/layout/components/AppMain.vue 1 KB
46444bd0   RuoYi   RuoYi-Vue 1.0
1
2
3
  <template>

    <section class="app-main">

      <transition name="fade-transform" mode="out-in">

ecc7a8be   RuoYi   优化多级菜单之间切换无法缓存的问题
4
        <keep-alive :include="cachedViews">

46444bd0   RuoYi   RuoYi-Vue 1.0
5
6
7
8
9
10
11
          <router-view :key="key" />

        </keep-alive>

      </transition>

    </section>

  </template>

  

  <script>

46444bd0   RuoYi   RuoYi-Vue 1.0
12
13
14
  export default {

    name: 'AppMain',

    computed: {

ecc7a8be   RuoYi   优化多级菜单之间切换无法缓存的问题
15
16
      cachedViews() {

        return this.$store.state.tagsView.cachedViews

46444bd0   RuoYi   RuoYi-Vue 1.0
17
18
      },

      key() {

ecc7a8be   RuoYi   优化多级菜单之间切换无法缓存的问题
19
20
21
22
        return this.$route.path

      }

    }

  }

46444bd0   RuoYi   RuoYi-Vue 1.0
23
24
25
26
27
28
29
30
31
32
33
  </script>

  

  <style lang="scss" scoped>

  .app-main {

    /* 50= navbar  50  */

    min-height: calc(100vh - 50px);

    width: 100%;

    position: relative;

    overflow: hidden;

  }

  

ecc7a8be   RuoYi   优化多级菜单之间切换无法缓存的问题
34
  .fixed-header+.app-main {

46444bd0   RuoYi   RuoYi-Vue 1.0
35
36
37
38
39
40
41
42
43
    padding-top: 50px;

  }

  

  .hasTagsView {

    .app-main {

      /* 84 = navbar + tags-view = 50 + 34 */

      min-height: calc(100vh - 84px);

    }

  

ecc7a8be   RuoYi   优化多级菜单之间切换无法缓存的问题
44
    .fixed-header+.app-main {

46444bd0   RuoYi   RuoYi-Vue 1.0
45
46
47
48
49
50
51
52
53
54
55
56
57
      padding-top: 84px;

    }

  }

  </style>

  

  <style lang="scss">

  // fix css style bug in open el-dialog

  .el-popup-parent--hidden {

    .fixed-header {

      padding-right: 15px;

    }

  }

  </style>