1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <template>
- <section class="app-main">
- <!-- -->
- <transition name="fade-transform" mode="out-in">
- <div>
- <router-view v-slot="{ Component }">
- <keep-alive>
- <component v-if="!keep" :is="Component" />
- </keep-alive>
- <component v-if="keep" :is="Component" />
- </router-view>
- <!-- <keep-alive exclude="nocatch">
- <router-view :key="key" v-if="needKeep" />
- </keep-alive>
- <router-view v-if="!needKeep" :key="key" /> -->
- </div>
- </transition>
- </section>
- </template>
- <script>
- import notKeepAliveList from "@/router/notKeepAliveList";
- export default {
- name: "AppMain",
- computed: {
- key() {
- return this.$route.path;
- },
- needKeep() {
- return !notKeepAliveList.includes(this.$route.path);
- },
- cachedViews() {
- return this.$store.state.tagsView.cachedViews;
- },
- keep() {
- return this.$route.meta.noCache*1; // 0是缓存 1是不缓存
- },
- },
- };
- </script>
- <style scoped>
- .app-main {
- /*50 = navbar */
- /* height: calc(100vh - 80px); */
- /* height: 100vh; */
- padding-top: 80px;
- /* min-width: 1440px; */
- position: relative;
- /* overflow: auto; */
- box-sizing: border-box;
- margin-left: 10px;
- margin-top: 20px;
- }
- .fixed-header + .app-main {
- padding-top: 80px;
- }
- </style>
- <style lang="scss">
- // fix css style bug in open el-dialog
- .el-popup-parent--hidden {
- .fixed-header {
- padding-right: 15px;
- }
- }
- </style>
|