PageHeader.vue 3.0 KB

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