DescriptionItem.vue 806 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view class="description-item">
  3. <view class="description-item__title" :style="{ width: labelWidth }">
  4. <slot name="title"></slot>
  5. </view>
  6. <view class="description-item__content">
  7. <slot name="content"></slot>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'DescriptionItem',
  14. props: {
  15. labelWidth: {
  16. type: String,
  17. default: ''
  18. }
  19. }
  20. };
  21. </script>
  22. <style lang="scss" scoped>
  23. .description-item {
  24. width: 100%;
  25. display: flex;
  26. align-items: center;
  27. line-height: 40rpx;
  28. margin-bottom: 24rpx;
  29. &__title {
  30. width: 112rpx;
  31. text-align: right;
  32. font-size: 28rpx;
  33. color: #9ba6a3;
  34. font-weight: 500;
  35. margin-right: 16rpx;
  36. }
  37. &__content {
  38. font-size: 28rpx;
  39. color: #042118;
  40. flex: 1;
  41. }
  42. }
  43. </style>