yudao-init/src/layout/components/AppMain.vue
2024-05-14 15:18:44 +08:00

74 lines
1.4 KiB
Vue

<!--
* @Author: zhp
* @Date: 2024-04-12 11:13:06
* @LastEditTime: 2024-05-08 13:37:05
* @LastEditors: zhp
* @Description:
-->
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<router-view v-if="!$route.meta.link" :key="key" />
</keep-alive>
</transition>
<iframe-toggle />
</section>
</template>
<script>
import iframeToggle from "./IframeToggle/index";
export default {
name: "AppMain",
components: { iframeToggle },
computed: {
cachedViews() {
return this.$store.state.tagsView.cachedViews;
},
key() {
return this.$route.path;
},
},
};
</script>
<style lang="scss" scoped>
.app-main {
/* 48= navbar 48 */
min-height: calc(100vh - 56px);
min-width: calc(100vh - 280px);
position: relative;
overflow: visible;
margin: 8px 14px 0px 16px;
border-radius: 8px;
// background-color: #fff;
}
.fixed-header + .app-main {
padding-top: 56px;
}
.hasTagsView {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 120px - 8px);
display: flex;
flex-direction: column;
}
.fixed-header + .app-main {
padding-top: 90px;
}
}
</style>
<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
.fixed-header {
padding-right: 17px;
}
}
</style>