You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.9 KiB

6 years ago
<template>
<main class="app-main">
<div v-show="!showIframe" class="scroll-container">
6 years ago
<page-view :include="cachedViews" :transition-name="transitionName"/>
<page-footer/>
</div>
6 years ago
<!--跨域iframe无法调整高度只能使用原生滚动条-->
<iframe
6 years ago
v-for="src in iframeList"
v-show="showIframe && src === currentIframe"
:id="src"
:key="src"
:src="src"
frameborder="0"
height="100%"
width="100%"
6 years ago
/>
6 years ago
<back-to-top :render="showBackToTop"/>
6 years ago
</main>
</template>
<script>
6 years ago
import {mapState} from 'vuex'
6 years ago
import BackToTop from "./component/BackToTop"
import PageView from "./component/PageView"
import PageFooter from "./component/PageFooter"
6 years ago
6 years ago
export default {
name: 'AppMain',
6 years ago
components: {BackToTop, PageView, PageFooter},
6 years ago
computed: {
...mapState('setting', ['showBackToTop']),
6 years ago
...mapState('tagsView', ['cachedViews', 'transitionName']),
6 years ago
...mapState('iframe', {
showIframe: state => state.show,
currentIframe: state => state.current,
iframeList: state => state.list
})
6 years ago
}
6 years ago
}
6 years ago
</script>
<style lang="scss">
@import "~@/asset/style/variables.scss";
6 years ago
.app-main {
position: relative;
flex: 1;
6 years ago
overflow: hidden;
background-color: #f5f7f9;
6 years ago
6 years ago
.scroll-container {
height: 100%;
display: flex;
flex-direction: column;
overflow-y: overlay;
overflow-x: inherit;
6 years ago
6 years ago
.page-view {
margin: $page-view-margin;
flex: 1;
6 years ago
}
}
.back-to-top {
height: 100%;
width: 100%;
background-color: #f2f5f6;
box-shadow: 0 0 6px rgba(0, 0, 0, .12);
text-align: center;
line-height: 40px;
color: #1989fa;
}
6 years ago
}
6 years ago
</style>