AppMain.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. </section>
  9. </template>
  10. <script>
  11. export default {
  12. name: "AppMain",
  13. computed: {
  14. cachedViews() {
  15. return this.$store.state.tagsView.cachedViews;
  16. },
  17. key() {
  18. return this.$route.path;
  19. },
  20. },
  21. };
  22. </script>
  23. <style lang="scss" scoped>
  24. // @import "~@/styles/mixin.scss";
  25. // @import "~@/styles/sidebar.scss";
  26. @import "~@/styles/variables.scss";
  27. @import "~@/styles/mixin.scss";
  28. @import "~@/styles/transition.scss";
  29. @import "~@/styles/element-ui.scss";
  30. @import "~@/styles/sidebar.scss";
  31. @import "~@/styles/btn.scss";
  32. .app-main {
  33. /* 50= navbar 50 */
  34. min-height: 100%;
  35. //calc(100vh - 50px);
  36. width: 100%;
  37. height: 100%;
  38. position: relative;
  39. overflow: scroll;
  40. padding: 0 0 0 0;
  41. box-sizing: border-box;
  42. @include scrollBar();
  43. }
  44. .fixed-header + .app-main {
  45. // min-height: calc(100vh - 50px);
  46. min-height: 100%;
  47. //calc(100vh - 50px);
  48. width: 100%;
  49. height: 100%;
  50. position: relative;
  51. overflow: scroll;
  52. padding: 0 0 0 0;
  53. padding-top: 50px;
  54. box-sizing: border-box;
  55. @include scrollBar();
  56. }
  57. .hasTagsView {
  58. .app-main {
  59. /* 84 = navbar + tags-view = 50 + 34 */
  60. min-height: 100%;
  61. min-height: 100%;
  62. //calc(100vh - 50px);
  63. width: 100%;
  64. height: 100%;
  65. position: relative;
  66. overflow: scroll;
  67. padding: 0 0 0 0;
  68. box-sizing: border-box;
  69. padding-top: 50px;
  70. @include scrollBar();
  71. }
  72. // .fixed-header+.app-main {
  73. // padding-top: 84px;
  74. // }
  75. }
  76. </style>
  77. <style lang="scss">
  78. // fix css style bug in open el-dialog
  79. .el-popup-parent--hidden {
  80. .fixed-header {
  81. padding-right: 15px;
  82. }
  83. }
  84. </style>