AppMain.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. }
  34. .fixed-header + .app-main {
  35. padding-top: 50px;
  36. }
  37. .hasTagsView {
  38. .app-main {
  39. /* 84 = navbar + tags-view = 50 + 34 */
  40. min-height: calc(100vh - 84px);
  41. }
  42. .fixed-header + .app-main {
  43. padding-top: 84px;
  44. }
  45. }
  46. </style>
  47. <style lang="scss">
  48. // fix css style bug in open el-dialog
  49. .el-popup-parent--hidden {
  50. .fixed-header {
  51. padding-right: 6px;
  52. }
  53. }
  54. ::-webkit-scrollbar {
  55. width: 6px;
  56. height: 6px;
  57. }
  58. ::-webkit-scrollbar-track {
  59. background-color: #f1f1f1;
  60. }
  61. ::-webkit-scrollbar-thumb {
  62. background-color: #c0c0c0;
  63. border-radius: 3px;
  64. }
  65. </style>