Commit 336b0c46 authored by 张伯涛's avatar 张伯涛

路由切换的白色动画添加判断

parent 57490be3
<template> <template>
<section class="app-main"> <section class="app-main">
<div class="container"> <div class="container">
<transition name="fade-transform" mode="out-in"> <!-- transition组件(过度动画)fade-transform(淡入变换)-->
<router-view :key="key" class="app-container-bg" /> <transition :name="animation" mode="out-in">
<!-- keep-alive组件,使被包含的组件保留状态,或避免重新渲染(匹配到的视图组件都会被缓存)-->
<keep-alive include="Home">
<router-view :key="key" class="sf-jump-page" />
</keep-alive>
</transition> </transition>
</div> </div>
</section> </section>
...@@ -14,40 +18,28 @@ export default { ...@@ -14,40 +18,28 @@ export default {
computed: { computed: {
key() { key() {
return this.$route.path return this.$route.path
},
animation() {
return this.$route.meta.needAnimation ? 'fade-transform' : undefined
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.app-main { .app-main {
/*50 = navbar */ /*50 = navbar */
/*min-height: 100vh;*/ /*min-height: 100vh;*/
width: 100%; width: 100%;
overflow-x: hidden;
overflow-y: auto;
position: relative; position: relative;
overflow: hidden; /*background: #fffff;*/
background-color: #F4F4F4; background-color: #f4f4f4;
.container{ padding-bottom: 0;
/*background-color: #ffffff;*/ box-sizing: border-box;
min-height: calc(92.4vh - 95px); .sf-jump-page {
//margin: 0 14px 14px 14px; min-height: calc(100vh - 178px);
border-radius: 3px;
background: #FFFFFF;
}
.app-container-bg{
background-color: #ffffff;
}
}
.fixed-header+.app-main {
//padding-top: 50px;
}
</style>
<style lang="scss">
// fix css style bug in open el-dialog
.el-popup-parent--hidden {
.fixed-header {
padding-right: 15px;
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment