AppMain.vue 782 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 scoped>
  24. .app-main {
  25. /*50 = navbar */
  26. min-height: calc(100vh - 50px);
  27. width: 100%;
  28. position: relative;
  29. overflow: hidden;
  30. }
  31. .fixed-header + .app-main {
  32. padding-top: 50px;
  33. }
  34. </style>
  35. <style lang="scss">
  36. // fix css style bug in open el-dialog
  37. .el-popup-parent--hidden {
  38. .fixed-header {
  39. padding-right: 15px;
  40. }
  41. }
  42. </style>