top.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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;">
  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">
  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. @headerHeight: 60px;
  46. @footerHeight: 52px;
  47. @contentWidth: 1260px;
  48. .main-framework--top{
  49. width: 100%;
  50. height: 100%;
  51. display: flex;
  52. justify-content: stretch;
  53. flex-direction: column;
  54. overflow-x: auto;
  55. .main-framework__header{
  56. flex-shrink: 0;
  57. width: 100%;
  58. overflow: hidden;
  59. min-width: @contentWidth;;
  60. }
  61. &__header{
  62. height: @headerHeight;
  63. display: flex;
  64. align-items: center;
  65. justify-content: space-between;
  66. flex-shrink: 0;
  67. overflow: hidden;
  68. width: @contentWidth;
  69. margin: 0 auto;
  70. }
  71. &__main{
  72. flex-shrink: 0;
  73. width: 100%;
  74. min-width: @contentWidth;
  75. height: 0;
  76. flex-grow: 2;
  77. box-sizing: border-box;
  78. overflow: auto;
  79. &__limit{
  80. width: @contentWidth;
  81. height: 100%;
  82. margin: 0 auto;
  83. }
  84. }
  85. &__footer{
  86. height: @footerHeight;
  87. }
  88. &__name{
  89. height: @headerHeight;
  90. display: flex;
  91. align-items: center;
  92. justify-content: flex-start;
  93. padding: 0 20px;
  94. box-sizing: border-box;
  95. flex-wrap: nowrap;
  96. white-space: nowrap;
  97. position: relative;
  98. z-index:1;
  99. }
  100. &__nav{
  101. flex-shrink: 0;
  102. }
  103. &__breadcrumb{
  104. position: absolute;
  105. top: @headerHeight;
  106. width: @contentWidth;
  107. margin: 0 auto;
  108. z-index: 9;
  109. box-sizing: border-box;
  110. }
  111. &__tabs{
  112. width: @contentWidth;
  113. margin: 0 auto;
  114. padding:0 20px;
  115. box-sizing: border-box;
  116. }
  117. }
  118. </style>