AppMain.vue 901 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. .app-main {
  25. /* 50= navbar 50 */
  26. min-height: calc(100vh - 50px);
  27. width: 100%;
  28. position: relative;
  29. }
  30. .fixed-header + .app-main {
  31. padding-top: 50px;
  32. }
  33. .hasTagsView {
  34. .app-main {
  35. /* 84 = navbar + tags-view = 50 + 34 */
  36. min-height: calc(100vh - 84px);
  37. }
  38. .fixed-header + .app-main {
  39. padding-top: 84px;
  40. }
  41. }
  42. </style>
  43. <style lang="scss">
  44. // fix css style bug in open el-dialog
  45. .el-popup-parent--hidden {
  46. .fixed-header {
  47. padding-right: 17px;
  48. }
  49. }
  50. </style>