<template>
    <section class="app-main">
        <!-- <breadcrumb v-if="$store.state.settings.topNav" id="breadcrumb-container" class="breadcrumb-container" /> -->
        <transition name="fade-transform" mode="out-in">
            <keep-alive :include="cachedViews">
                <router-view v-if="!$route.meta.link" :key="key" />
                <inner-link v-else :iframeId="'iframe' + key" :src="$route.meta.link"></inner-link>
            </keep-alive>
        </transition>
        <iframe-toggle />
    </section>
</template>

<script>
import iframeToggle from './IframeToggle/index';
import InnerLink from './InnerLink/index';
import Breadcrumb from '@/components/Breadcrumb';
export default {
    name: 'AppMain',
    components: { iframeToggle, InnerLink, Breadcrumb },
    computed: {
        cachedViews() {
            return this.$store.state.tagsView.cachedViews;
        },
        key() {
            return this.$route.path;
        },
    },
};
</script>

<style lang="scss" scoped>
.app-main {
    /* 50= navbar  50  */
    min-height: calc(100% - 50px);
    width: 100%;
    position: relative;
}

.fixed-header + .app-main {
    padding-top: 50px;
}

.hasTagsView {
    /* .app-main {
         84 = navbar + tags-view = 50 + 34 
        min-height: calc(100vh - 127.3px);
    }
*/
    .fixed-header + .app-main {
        padding-top: 127.3;
    }
}
</style>

<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
    .fixed-header {
        padding-right: 17px;
    }
}
</style>
