goods-unit-section.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="goods-unit-section">
  3. <view class="section" @click="$emit('click')">
  4. <view class="label">规格:</view>
  5. <view class="list"><text v-text="text"></text></view>
  6. <view class="iconfont icon-chakangengduo"></view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. props: {
  13. skuList: {
  14. type: Array,
  15. default: () => []
  16. }
  17. },
  18. computed: {
  19. text() {
  20. const len = this.skuList.length
  21. return `共${len}种规格可选`
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. .goods-unit-section {
  28. padding: 24rpx;
  29. background-color: #fff;
  30. .section {
  31. @extend .cm-flex-between;
  32. font-size: 28rpx;
  33. .label {
  34. color: #666;
  35. }
  36. .list {
  37. flex: 1;
  38. margin: 0 24rpx;
  39. color: #333;
  40. text {
  41. margin-right: 24rpx;
  42. }
  43. }
  44. .iconfont {
  45. font-size: 28rpx;
  46. color: #666;
  47. }
  48. }
  49. }
  50. </style>