swiperDot.vue 660 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="dot-main">
  3. <view :class="['dot-item',current==index?'active':'']" v-for="(item,index) in list" :key="index"></view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: [ 'list','current'],
  9. data() {
  10. return {
  11. };
  12. }
  13. }
  14. </script>
  15. <style>
  16. .dot-main {
  17. width: 100%;
  18. display: flex;
  19. flex-direction:row-reverse;
  20. align-items: center;
  21. }
  22. .dot-item {
  23. width: 16rpx;
  24. height: 16rpx;
  25. border: 2rpx solid #0A8CD5;
  26. background-color: #fff;
  27. border-radius: 50%;
  28. margin: 0 6upx;
  29. box-sizing: border-box;
  30. }
  31. .active {
  32. width: 40rpx;
  33. height: 16rpx;
  34. background-color: #0A8CD5;
  35. border-radius: 10rpx;
  36. }
  37. </style>