SectionTitle.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view class="section-wrapper">
  3. <view class="section-header">
  4. <view class="section-title">{{ title }}</view>
  5. <view class="section-header-right">
  6. <slot name="header-right"></slot>
  7. </view>
  8. </view>
  9. <view class="section-body">
  10. <slot></slot>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'SectionTitle',
  17. props: {
  18. title: {
  19. type: String,
  20. default: ''
  21. }
  22. }
  23. }
  24. </script>
  25. <style lang="scss" scoped>
  26. .section-wrapper {
  27. background: #fff;
  28. border-radius: 20rpx;
  29. padding: 32rpx;
  30. margin-bottom: 24rpx;
  31. border: 1rpx solid #e0e0e0;
  32. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
  33. }
  34. .section-header {
  35. display: flex;
  36. justify-content: space-between;
  37. align-items: center;
  38. margin-bottom: 24rpx;
  39. }
  40. .section-title {
  41. font-size: 30rpx;
  42. font-weight: 600;
  43. color: #333;
  44. position: relative;
  45. padding-left: 16rpx;
  46. &::before {
  47. content: '';
  48. position: absolute;
  49. left: 0;
  50. top: 50%;
  51. transform: translateY(-50%);
  52. width: 4rpx;
  53. height: 28rpx;
  54. background: #60A5FA;
  55. border-radius: 2rpx;
  56. }
  57. }
  58. .section-header-right {
  59. font-size: 24rpx;
  60. color: #666;
  61. }
  62. </style>