AppMain.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <section class="app-main">
  3. <router-view v-slot="{ Component, route }">
  4. <transition name="fade-transform" mode="out-in">
  5. <keep-alive :include="tagsViewStore.cachedViews">
  6. <component v-if="!route.meta.link" :is="Component" :key="route.path"/>
  7. </keep-alive>
  8. </transition>
  9. </router-view>
  10. <iframe-toggle />
  11. </section>
  12. </template>
  13. <script setup>
  14. import iframeToggle from "./IframeToggle/index"
  15. import useTagsViewStore from '@/store/modules/tagsView'
  16. const tagsViewStore = useTagsViewStore()
  17. </script>
  18. <style lang="scss" scoped>
  19. .app-main {
  20. /* 50= navbar 50 */
  21. height: calc(100vh - 100px);
  22. width: 100%;
  23. position: relative;
  24. overflow-y: auto;
  25. }
  26. .fixed-header + .app-main {
  27. padding-top: 50px;
  28. }
  29. .hasTagsView {
  30. .app-main {
  31. /* 84 = navbar + tags-view = 50 + 34 */
  32. height: calc(100vh - 100px);
  33. }
  34. .fixed-header + .app-main {
  35. padding-top: 84px;
  36. }
  37. }
  38. </style>
  39. <style lang="scss">
  40. // fix css style bug in open el-dialog
  41. .el-popup-parent--hidden {
  42. .fixed-header {
  43. padding-right: 17px;
  44. }
  45. }
  46. </style>