AppMain.vue 842 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <section class="app-main">
  3. <transition name="fade-transform" mode="out-in">
  4. <keep-alive v-if="$route.name">
  5. <router-view :key="$route.name" />
  6. </keep-alive>
  7. <router-view v-else />
  8. </transition>
  9. </section>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'AppMain',
  14. computed: {
  15. cachedViews() {
  16. return this.$store.state.tagsView.cachedViews
  17. },
  18. key() {
  19. return this.$route.path
  20. }
  21. }
  22. }
  23. </script>
  24. <style scoped>
  25. .app-main {
  26. /*50 = navbar */
  27. min-height: calc(100vh - 50px);
  28. width: 100%;
  29. position: relative;
  30. overflow: hidden;
  31. }
  32. .fixed-header + .app-main {
  33. /* padding-top: 50px; */
  34. padding-top: 80px;
  35. }
  36. </style>
  37. <style lang="scss">
  38. // fix css style bug in open el-dialog
  39. .el-popup-parent--hidden {
  40. .fixed-header {
  41. padding-right: 15px;
  42. }
  43. }
  44. </style>