label-count.vue 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="slot">
  3. <view class="item" :style="{ width: 100 / ops.length + '%' }" v-for="(item, index) in ops" :key="index" @click="$u.route({ url: item.url })">
  4. <view class="count">{{ item.count || 0 }}</view>
  5. <view class="label">{{ item.label || '未命名' }}</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'label-count',
  12. props: {
  13. // 配置项
  14. ops: {
  15. type: Array,
  16. default: () => {
  17. return [];
  18. }
  19. }
  20. }
  21. };
  22. </script>
  23. <style lang="scss" scoped>
  24. .slot {
  25. background-color: $app-theme-bg-color;
  26. display: flex;
  27. justify-content: space-between;
  28. align-items: center;
  29. border-radius: 16rpx;
  30. box-shadow: $app-theme-shadow;
  31. padding: 40rpx 0;
  32. .item {
  33. text-align: center;
  34. .count {
  35. font-size: 40rpx;
  36. font-family: DINAlternate-Bold, DINAlternate;
  37. font-weight: bold;
  38. color: $app-theme-text-black-color;
  39. margin-bottom: 16rpx;
  40. }
  41. .label {
  42. font-size: 24rpx;
  43. font-weight: 400;
  44. color: $app-theme-text-gray-color;
  45. }
  46. }
  47. }
  48. </style>