PageHeader.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <script setup lang="ts">
  2. import Breadcrumb from '@/components/Breadcrumb/Breadcrumb.vue'
  3. const route = useRoute()
  4. const display = computed(() => {
  5. return !route.meta.hiddenHeaderContent
  6. })
  7. const name = computed(() => {
  8. return (route.meta.name as () => string)()
  9. })
  10. </script>
  11. <template>
  12. <div
  13. v-if="display"
  14. class="page-header"
  15. >
  16. <div class="page-header-index-wide">
  17. <Breadcrumb />
  18. <div class="detail">
  19. <div class="main">
  20. <div class="row">
  21. <h1 class="title">
  22. {{ name }}
  23. </h1>
  24. <div class="action">
  25. <slot name="action" />
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <style lang="less" scoped>
  34. .dark {
  35. .page-header {
  36. background: #090909 !important;
  37. border-bottom: unset;
  38. h1 {
  39. color: #fafafa;
  40. }
  41. }
  42. }
  43. .page-header {
  44. background: #fff;
  45. padding: 16px 32px 0;
  46. border-bottom: 1px solid #e8e8e8;
  47. .breadcrumb {
  48. margin-bottom: 16px;
  49. }
  50. @media (max-height: 768px) {
  51. display: none;
  52. }
  53. .detail {
  54. display: flex;
  55. /*margin-bottom: 16px;*/
  56. .avatar {
  57. flex: 0 1 72px;
  58. margin: 0 24px 8px 0;
  59. & > span {
  60. border-radius: 72px;
  61. display: block;
  62. width: 72px;
  63. height: 72px;
  64. }
  65. }
  66. .main {
  67. width: 100%;
  68. flex: 0 1 auto;
  69. .row {
  70. display: flex;
  71. width: 100%;
  72. .avatar {
  73. margin-bottom: 16px;
  74. }
  75. }
  76. .title {
  77. font-size: 20px;
  78. font-weight: 500;
  79. line-height: 28px;
  80. margin-bottom: 16px;
  81. flex: auto;
  82. }
  83. .logo {
  84. width: 28px;
  85. height: 28px;
  86. border-radius: 4px;
  87. margin-right: 16px;
  88. }
  89. .content,
  90. .headerContent {
  91. flex: auto;
  92. line-height: 22px;
  93. .link {
  94. margin-top: 16px;
  95. line-height: 24px;
  96. a {
  97. font-size: 14px;
  98. margin-right: 32px;
  99. }
  100. }
  101. }
  102. .extra {
  103. flex: 0 1 auto;
  104. margin-left: 88px;
  105. min-width: 242px;
  106. text-align: right;
  107. }
  108. .action {
  109. margin-left: 56px;
  110. min-width: 266px;
  111. flex: 0 1 auto;
  112. text-align: right;
  113. &:empty {
  114. display: none;
  115. }
  116. }
  117. }
  118. }
  119. }
  120. .mobile .page-header {
  121. .main {
  122. .row {
  123. flex-wrap: wrap;
  124. .avatar {
  125. flex: 0 1 25%;
  126. margin: 0 2% 8px 0;
  127. }
  128. .content,
  129. .headerContent {
  130. flex: 0 1 70%;
  131. .link {
  132. margin-top: 16px;
  133. line-height: 24px;
  134. a {
  135. font-size: 14px;
  136. margin-right: 10px;
  137. }
  138. }
  139. }
  140. .extra {
  141. flex: 1 1 auto;
  142. margin-left: 0;
  143. min-width: 0;
  144. text-align: right;
  145. }
  146. .action {
  147. margin-left: unset;
  148. min-width: 266px;
  149. flex: 0 1 auto;
  150. text-align: left;
  151. margin-bottom: 12px;
  152. &:empty {
  153. display: none;
  154. }
  155. }
  156. }
  157. }
  158. }
  159. </style>