12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <template>
- <section class="app-main">
- <!-- -->
- <transition name="fade-transform" mode="out-in">
- <div>
- <keep-alive >
- <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;
- },
- },
- };
- </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>
|