index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div class="d-catalog">
  3. <div class="d-header">
  4. <span>{{ title }}</span>
  5. <div class="h-right" v-if="slots.headerRight">
  6. <a-space>
  7. <slot name="headerRight"></slot>
  8. </a-space>
  9. </div>
  10. </div>
  11. <div class="d-content" v-if="slots.content">
  12. <slot name="content"></slot>
  13. </div>
  14. </div>
  15. </template>
  16. <script setup>
  17. import { useSlots } from "vue";
  18. const props = defineProps({
  19. title: {
  20. required: true,
  21. default: '标题',
  22. },
  23. });
  24. const slots = useSlots()
  25. </script>
  26. <style lang="scss" scoped>
  27. .d-catalog {
  28. width: 100%;
  29. height: 100%;
  30. .d-header {
  31. font-size: 16px;
  32. font-weight: 600;
  33. padding: 10px 0 10px 10px;
  34. border-bottom: 1px solid #e4e7ed;
  35. cursor: pointer;
  36. position: relative;
  37. display: flex;
  38. align-items: center;
  39. justify-content: space-between;
  40. gap: 10px;
  41. &::before {
  42. width: 4px;
  43. height: 18px;
  44. background: var(--vxe-ui-font-primary-color);
  45. position: absolute;
  46. left: 0;
  47. top: 50%;
  48. transform: translateY(-50%);
  49. content: '';
  50. border-radius: 4px;
  51. }
  52. .h-right {
  53. position: absolute;
  54. right: 0;
  55. bottom: 6px;
  56. }
  57. }
  58. .d-content {
  59. width: 100%;
  60. height: 100%;
  61. padding: 20px 0;
  62. }
  63. }
  64. </style>