index.vue 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view class="cell" :style="{ height: `${height}px` }">
  3. <view class="left-title">
  4. <slot v-if="$slots.title" name="title"></slot>
  5. <text v-else>{{ title }}</text>
  6. </view>
  7. <view class="right-box">
  8. <slot v-if="$slots.value" name="value"></slot>
  9. <text v-else>{{ value }}</text>
  10. <u-icon v-if="isLink" name="arrow-right"></u-icon>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'cCell',
  17. props: {
  18. height: [String, Number],
  19. title: String,
  20. value: [String, Number],
  21. isLink: Boolean,
  22. },
  23. };
  24. </script>
  25. <style scoped lang="scss">
  26. .cell {
  27. display: flex;
  28. align-items: center;
  29. justify-content: space-between;
  30. border-bottom: 1px solid #edeeef;
  31. background-color: #fff;
  32. &:last-child {
  33. border-bottom: 0;
  34. }
  35. padding: 28rpx;
  36. .left-title {
  37. display: flex;
  38. align-items: center;
  39. color: #303133;
  40. font-size: 14px;
  41. }
  42. .right-box {
  43. display: flex;
  44. align-items: center;
  45. font-size: 14px;
  46. color: #7b7e8c;
  47. }
  48. }
  49. </style>