AppMain.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <section class="app-main">
  3. <transition name="fade-transform" mode="out-in">
  4. <keep-alive :include="cachedViews">
  5. <router-view v-if="!$route.meta.link" :key="key" />
  6. </keep-alive>
  7. </transition>
  8. <iframe-toggle />
  9. </section>
  10. </template>
  11. <script>
  12. import iframeToggle from "./IframeToggle/index"
  13. export default {
  14. name: 'AppMain',
  15. components: { iframeToggle },
  16. computed: {
  17. cachedViews() {
  18. return this.$store.state.tagsView.cachedViews
  19. },
  20. key() {
  21. return this.$route.path
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. .app-main {
  28. /* 50= navbar 50 */
  29. min-height: calc(100vh - 50px);
  30. width: 100%;
  31. position: relative;
  32. overflow: hidden;
  33. background: #F6F7FD;
  34. padding: 20px;
  35. }
  36. .fixed-header + .app-main {
  37. padding-top: 50px;
  38. }
  39. .hasTagsView {
  40. .app-main {
  41. /* 84 = navbar + tags-view = 50 + 34 */
  42. min-height: calc(100vh - 84px);
  43. }
  44. .fixed-header + .app-main {
  45. padding-top: 84px;
  46. }
  47. }
  48. </style>
  49. <style lang="scss">
  50. // fix css style bug in open el-dialog
  51. .el-popup-parent--hidden {
  52. .fixed-header {
  53. padding-right: 6px;
  54. }
  55. }
  56. ::-webkit-scrollbar {
  57. width: 6px;
  58. height: 6px;
  59. }
  60. ::-webkit-scrollbar-track {
  61. background-color: #f1f1f1;
  62. }
  63. ::-webkit-scrollbar-thumb {
  64. background-color: #c0c0c0;
  65. border-radius: 3px;
  66. }
  67. </style>