AppMain.vue 1.0 KB

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