InfoItem.vue 914 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <view :class="[isFirst ? 'no-border' : '', 'info-item-component']">
  3. <text class="label">{{ label }}</text>
  4. <template v-if="isImage">
  5. <image class="kqt-image" :src="value"></image>
  6. </template>
  7. <text v-else class="value">{{ value }}</text>
  8. </view>
  9. </template>
  10. <script setup>
  11. import { defineProps } from 'vue';
  12. const props = defineProps({
  13. label: String,
  14. value: [String, Number],
  15. isFirst: Boolean,
  16. isImage: Boolean
  17. });
  18. </script>
  19. <style lang="scss" scoped>
  20. .info-item-component {
  21. display: flex;
  22. justify-content: space-between;
  23. align-items: center;
  24. padding: 30rpx 0;
  25. border-top: 1px solid #e5e9ed;
  26. &.no-border {
  27. border: none;
  28. }
  29. .label {
  30. font-weight: bold;
  31. color: #777777;
  32. }
  33. .value, .kqt-image {
  34. flex: 1;
  35. text-align: right;
  36. color: #0f2239;
  37. font-weight: 600;
  38. }
  39. .kqt-image {
  40. max-width: 50%;
  41. }
  42. }
  43. </style>