top.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div class="main-framework--top main-framework">
  3. <header class="main-framework__header">
  4. <div class="main-framework--top__header">
  5. <div style="display: flex; flex-grow: 2;">
  6. <div class="main-framework--top__name main-framework__name">
  7. <!--使用展开的name数据-->
  8. <slot name="name" :is-collapse="false"></slot>
  9. </div>
  10. <div class="main-framework--top__nav" style="flex-grow: 2">
  11. <slot name="nav" :is-collapse="false"></slot>
  12. </div>
  13. </div>
  14. <slot name="header"></slot>
  15. </div>
  16. </header>
  17. <div class="main-framework--top__tabs" v-show="withTabs === true">
  18. <slot name="tabs" ></slot>
  19. </div>
  20. <main class="main-framework--top__main main-framework__main">
  21. <div class="main-framework--top__main__limit">
  22. <div class="main-framework--top__breadcrumb">
  23. <!-- <slot name="breadcrumb"></slot>-->
  24. </div>
  25. <slot></slot>
  26. </div>
  27. </main>
  28. <footer class="main-framework--top__footer main-framework__footer" v-if="!hideFooter">
  29. <slot name="footer"></slot>
  30. </footer>
  31. </div>
  32. </template>
  33. <script>
  34. import { defineComponent } from 'vue'
  35. export default defineComponent({
  36. name: 'MainFrameworkTop',
  37. props: {
  38. hideFooter: Boolean,
  39. layout: String,
  40. withTabs: Boolean
  41. }
  42. })
  43. </script>
  44. <style lang="less">
  45. @footerHeight: 52px;
  46. @contentWidth: 1260px;
  47. .main-framework--top{
  48. width: 100%;
  49. height: 100%;
  50. display: flex;
  51. justify-content: stretch;
  52. flex-direction: column;
  53. overflow-x: auto;
  54. .main-framework__header{
  55. flex-shrink: 0;
  56. width: 100%;
  57. overflow: hidden;
  58. min-width: @contentWidth;;
  59. }
  60. &__header{
  61. height: var(--main-framework-header-height, 52px);
  62. display: flex;
  63. align-items: center;
  64. justify-content: space-between;
  65. flex-shrink: 0;
  66. overflow: hidden;
  67. width: @contentWidth;
  68. margin: 0 auto;
  69. }
  70. &__main{
  71. flex-shrink: 0;
  72. width: 100%;
  73. min-width: @contentWidth;
  74. height: 0;
  75. flex-grow: 2;
  76. box-sizing: border-box;
  77. overflow: auto;
  78. &__limit{
  79. width: @contentWidth;
  80. height: 100%;
  81. margin: 0 auto;
  82. }
  83. }
  84. &__footer{
  85. height: @footerHeight;
  86. }
  87. &__name{
  88. height: var(--main-framework-header-height, 52px);
  89. display: flex;
  90. align-items: center;
  91. justify-content: flex-start;
  92. padding: 0 20px;
  93. box-sizing: border-box;
  94. flex-wrap: nowrap;
  95. white-space: nowrap;
  96. position: relative;
  97. z-index:1;
  98. }
  99. &__nav{
  100. flex-shrink: 0;
  101. }
  102. &__breadcrumb{
  103. position: absolute;
  104. top: var(--main-framework-header-height, 52px);
  105. width: @contentWidth;
  106. margin: 0 auto;
  107. z-index: 9;
  108. box-sizing: border-box;
  109. }
  110. &__tabs{
  111. width: @contentWidth;
  112. margin: 0 auto;
  113. padding:0;
  114. box-sizing: border-box;
  115. }
  116. }
  117. </style>