AppMain.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <section class="app-main">
  3. <transition name="fade-transform" mode="out-in">
  4. <keep-alive :include="cachedViews">
  5. <router-view :key="key" />
  6. </keep-alive>
  7. </transition>
  8. <span class="footer">
  9. Copyright
  10. </span>
  11. </section>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'AppMain',
  16. computed: {
  17. cachedViews() {
  18. return this.$store.state.tagsView.cachedViews
  19. },
  20. key() {
  21. return this.$route.path
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. @import "~@/styles/variables.scss";
  28. .app-main {
  29. min-height: calc(100vh - #{$headerHeight});
  30. width: 100%;
  31. position: relative;
  32. overflow: auto;
  33. padding-bottom: $footerHeight;
  34. &>div:not(.home-container) {
  35. height: calc(100vh - #{$layoutHeight});
  36. padding: 10px 0 0 10px;
  37. }
  38. }
  39. .hasTagsView {
  40. .app-main {
  41. min-height: calc(100vh - #{$headerHeight} - #{$tagHeight});
  42. }
  43. .fixed-header+.app-main {
  44. min-height: calc(100vh - #{$headerHeight});
  45. padding-top: $tagHeight;
  46. }
  47. }
  48. .footer {
  49. display: block;
  50. width: 100%;
  51. height: $footerHeight;
  52. line-height: $footerHeight;
  53. font-size: 12px;
  54. color: rgba(0,0,0,0.45);
  55. text-align: center;
  56. position: absolute;
  57. left: 0;
  58. bottom: 0;
  59. }
  60. </style>
  61. <style lang="scss">
  62. // fix css style bug in open el-dialog
  63. .el-popup-parent--hidden {
  64. .fixed-header {
  65. padding-right: 15px;
  66. }
  67. }
  68. </style>