base.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="base-container" v-if="dataList.length">
  3. <view class="base-list">
  4. <view class="base-item" v-for="(item, index) in dataList" :key="index">
  5. <view class="base-item-value">{{ item.value }}</view>
  6. <view class="base-item-label">{{
  7. item.sfDisplayname || item.sfName
  8. }}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. dataList: {
  17. type: Array,
  18. default: () => [],
  19. },
  20. },
  21. data() {
  22. return {};
  23. },
  24. };
  25. </script>
  26. <style scoped lang="scss">
  27. .base-container {
  28. display: flex;
  29. flex-direction: column;
  30. align-items: center;
  31. padding: 16rpx 0;
  32. justify-content: space-between;
  33. border-radius: 16rpx;
  34. background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
  35. margin: 30rpx 0;
  36. .base-list {
  37. width: calc(100% - 32rpx);
  38. padding: 0 16px;
  39. display: grid;
  40. grid-template-columns: repeat(4, 1fr);
  41. .base-item {
  42. text-align: center;
  43. .base-item-value {
  44. width: 150rpx;
  45. color: #042118;
  46. font-family: 'Source Han Sans CN VF';
  47. font-size: 32rpx;
  48. font-weight: 500;
  49. text-align: center;
  50. // 超出隐藏
  51. overflow: hidden;
  52. text-overflow: ellipsis;
  53. white-space: nowrap;
  54. }
  55. .base-item-label {
  56. width: 150rpx;
  57. color: #687a74;
  58. font-family: 'Source Han Sans CN VF';
  59. text-align: center;
  60. font-size: 28rpx;
  61. font-weight: 400;
  62. // 超出隐藏
  63. overflow: hidden;
  64. text-overflow: ellipsis;
  65. white-space: nowrap;
  66. }
  67. }
  68. }
  69. }
  70. </style>