|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<main class="app-main"> |
|
|
|
<main class="app-main"> |
|
|
|
<el-scrollbar ref="scrollbar" v-show="!showIframe" class="scroll-container"> |
|
|
|
<div v-show="!showIframe" class="scroll-container"> |
|
|
|
<div class="page-view"> |
|
|
|
<div class="page-view"> |
|
|
|
<keep-router-view-alive :include="cachedViews"> |
|
|
|
<keep-router-view-alive :include="cachedViews"> |
|
|
|
<transition :name="transitionName" mode="out-in"> |
|
|
|
<transition :name="transitionName" mode="out-in"> |
|
|
|
@ -8,7 +8,8 @@ |
|
|
|
</transition> |
|
|
|
</transition> |
|
|
|
</keep-router-view-alive> |
|
|
|
</keep-router-view-alive> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-scrollbar> |
|
|
|
<v-footer/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!--跨域iframe无法调整高度,只能使用原生滚动条--> |
|
|
|
<!--跨域iframe无法调整高度,只能使用原生滚动条--> |
|
|
|
<iframe |
|
|
|
<iframe |
|
|
|
@ -24,7 +25,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<el-backtop |
|
|
|
<el-backtop |
|
|
|
v-if="showBackToTop" |
|
|
|
v-if="showBackToTop" |
|
|
|
target=".app-main .el-scrollbar__wrap" |
|
|
|
target=".app-main .scroll-container" |
|
|
|
:visibility-height="400" |
|
|
|
:visibility-height="400" |
|
|
|
:bottom="66" |
|
|
|
:bottom="66" |
|
|
|
> |
|
|
|
> |
|
|
|
@ -36,19 +37,16 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import Vue from 'vue' |
|
|
|
|
|
|
|
import {mapState} from 'vuex' |
|
|
|
import {mapState} from 'vuex' |
|
|
|
import KeepRouterViewAlive from "./KeepAlive" |
|
|
|
import KeepRouterViewAlive from "./KeepAlive" |
|
|
|
import Footer from "./Footer" |
|
|
|
import VFooter from "./Footer" |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'AppMain', |
|
|
|
name: 'AppMain', |
|
|
|
|
|
|
|
|
|
|
|
components: {KeepRouterViewAlive}, |
|
|
|
components: {KeepRouterViewAlive, VFooter}, |
|
|
|
|
|
|
|
|
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
...mapState('app', ['scrollTop']), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
...mapState('setting', ['showBackToTop']), |
|
|
|
...mapState('setting', ['showBackToTop']), |
|
|
|
|
|
|
|
|
|
|
|
...mapState('tagsView', ['cachedViews', 'transitionName']), |
|
|
|
...mapState('tagsView', ['cachedViews', 'transitionName']), |
|
|
|
@ -58,19 +56,6 @@ export default { |
|
|
|
currentIframe: state => state.current, |
|
|
|
currentIframe: state => state.current, |
|
|
|
iframeList: state => state.list |
|
|
|
iframeList: state => state.list |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
scrollTop(v) { |
|
|
|
|
|
|
|
if (v >= 0) this.$refs.scrollbar.$refs.wrap.scrollTop = v |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mounted() { |
|
|
|
|
|
|
|
//插入footer |
|
|
|
|
|
|
|
const FooterConstructor = Vue.extend(Footer) |
|
|
|
|
|
|
|
const footerInstance = new FooterConstructor().$mount() |
|
|
|
|
|
|
|
this.$refs.scrollbar.$refs.wrap.appendChild(footerInstance.$el) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
@ -80,30 +65,21 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
.app-main { |
|
|
|
.app-main { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
|
|
|
|
flex: 1; |
|
|
|
overflow: hidden; |
|
|
|
overflow: hidden; |
|
|
|
background-color: #f5f7f9; |
|
|
|
background-color: #f5f7f9; |
|
|
|
flex: 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.scroll-container { |
|
|
|
.scroll-container { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
height: 100%; |
|
|
|
height: 100%; |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
overflow-y: overlay; |
|
|
|
|
|
|
|
overflow-x: inherit; |
|
|
|
|
|
|
|
|
|
|
|
.page-view { |
|
|
|
.page-view { |
|
|
|
margin: $page-view-margin; |
|
|
|
margin: $page-view-margin; |
|
|
|
} |
|
|
|
flex: 1; |
|
|
|
|
|
|
|
|
|
|
|
> .el-scrollbar__bar.is-horizontal { |
|
|
|
|
|
|
|
display: none !important; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
> .el-scrollbar__wrap { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
overflow-x: hidden; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.el-scrollbar__view { |
|
|
|
|
|
|
|
flex: 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|