Progress-Bar.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view>
  3. <view class="progress" :class="Type" :style="{width: widthUpx + 'rpx'}">
  4. <view class="progress-text" v-if="Vice == true" :style="{width: widthUpx + 'rpx'}">
  5. 已抢{{Sold}}件
  6. {{ Width + '%' }}
  7. </view>
  8. <view class="progress-bar" :style="{width: Width+'%'}"><view class="progress-text" v-if="Main == true">{{ Width + '%' }}</view></view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. // 已卖多少件
  16. Sold: {
  17. type: Number,
  18. default: 0
  19. },
  20. // 进度条宽度
  21. widthUpx: {
  22. type: Number,
  23. default: 710
  24. },
  25. // 进度条百分比
  26. Width: {
  27. type: Number,
  28. default: 0
  29. },
  30. // 进度条样式
  31. /*
  32. aqua
  33. copper
  34. candy
  35. neon
  36. shine
  37. zigzag
  38. diamond
  39. hearts
  40. sparkle
  41. */
  42. Type: {
  43. type: String,
  44. default: 'aqua',
  45. },
  46. // 主进度显示百分比
  47. Main: {
  48. type: Boolean,
  49. default: true,
  50. },
  51. // 副进度显示百分比
  52. Vice: {
  53. type: Boolean,
  54. default: true,
  55. },
  56. },
  57. data() {
  58. return {
  59. };
  60. },
  61. methods: {}
  62. };
  63. </script>
  64. <style>
  65. @import url('Progress-Bar.css');
  66. </style>