DetailHeader.vue 875 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="header">
  3. <el-button @click="$emit('back')"> 返回 </el-button>
  4. <h2 class="title">
  5. {{ title }}
  6. </h2>
  7. <div v-if="$slots.right" class="header-right">
  8. <slot name="right" />
  9. </div>
  10. </div>
  11. </template>
  12. <script setup lang="ts" name="DetailHeader">
  13. defineProps<{
  14. title: string;
  15. }>();
  16. defineEmits<{
  17. (e: "back"): void;
  18. }>();
  19. </script>
  20. <style scoped lang="scss">
  21. /* 与订单详情、代金券详情等页面一致的头部结构,仅用于经营数据模块 */
  22. .header {
  23. display: flex;
  24. align-items: center;
  25. padding: 20px 24px;
  26. background-color: #ffffff;
  27. border-bottom: 1px solid #e4e7ed;
  28. box-shadow: 0 2px 4px rgb(0 0 0 / 2%);
  29. }
  30. .title {
  31. flex: 1;
  32. margin: 0;
  33. font-size: 18px;
  34. font-weight: 600;
  35. color: #303133;
  36. text-align: center;
  37. }
  38. .header-right {
  39. flex-shrink: 0;
  40. min-width: 60px;
  41. }
  42. </style>