swiper-dots.vue 784 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <view class="dots">
  3. <view class="dot" v-for="item in pageAll" :key="item" :class="isActive === item ? 'active' : ''" @click="$emit('hanlderClick', item)"></view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. pageAll: {
  10. type: Number,
  11. default: () => 0
  12. },
  13. isActive: {
  14. type: Number,
  15. default: () => 0
  16. }
  17. },
  18. }
  19. </script>
  20. <style scoped lang="scss">
  21. .dots {
  22. width: 100%;
  23. display: flex;
  24. justify-content: center;
  25. align-items: center;
  26. .dot {
  27. width: 12rpx;
  28. height: 12rpx;
  29. border-radius: 50%;
  30. background: rgba(255, 91, 0, 0.4);
  31. margin-right: 20rpx;
  32. }
  33. }
  34. .active {
  35. background: #FF5B00 !important;
  36. }
  37. </style>