AppMain.vue 1016 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <section class="app-main">
  3. <transition name="fade-transform" mode="out-in">
  4. <keep-alive :include="cachedViews">
  5. <router-view class="router_mains" :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. .app-main {
  25. /* 50= navbar 50 */
  26. min-height: calc(100vh - 50px);
  27. width: 100%;
  28. position: relative;
  29. overflow: hidden;
  30. padding: 20px;
  31. }
  32. .fixed-header + .app-main {
  33. padding-top: 50px;
  34. }
  35. .hasTagsView {
  36. .app-main {
  37. /* 84 = navbar + tags-view = 50 + 34 */
  38. min-height: calc(100vh - 84px);
  39. }
  40. .fixed-header + .app-main {
  41. padding-top: 96px;
  42. }
  43. }
  44. </style>
  45. <style lang="scss">
  46. // fix css style bug in open el-dialog
  47. .el-popup-parent--hidden {
  48. .fixed-header {
  49. padding-right: 17px;
  50. }
  51. }
  52. </style>