progress.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view>
  3. <page-head :title="title"></page-head>
  4. <view class="uni-padding-wrap uni-common-mt">
  5. <view class="progress-box">
  6. <progress :percent="pgList[0]" show-info stroke-width="3" />
  7. </view>
  8. <view class="progress-box">
  9. <progress :percent="pgList[1]" stroke-width="3" />
  10. <uni-icons type="close" class="progress-cancel" color="#dd524d"></uni-icons>
  11. </view>
  12. <view class="progress-box">
  13. <progress :percent="pgList[2]" stroke-width="3" />
  14. </view>
  15. <view class="progress-box">
  16. <progress :percent="pgList[3]" activeColor="#10AEFF" stroke-width="3" />
  17. </view>
  18. <view class="progress-control">
  19. <button type="primary" @click="setProgress">设置进度</button>
  20. <button type="warn" @click="clearProgress">清除进度</button>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. title: 'progress',
  30. pgList: [0, 0, 0, 0]
  31. }
  32. },
  33. methods: {
  34. setProgress() {
  35. this.pgList = [20, 40, 60, 80]
  36. },
  37. clearProgress() {
  38. this.pgList = [0, 0, 0, 0]
  39. }
  40. }
  41. }
  42. </script>
  43. <style>
  44. .progress-box {
  45. display: flex;
  46. height: 50rpx;
  47. margin-bottom: 60rpx;
  48. }
  49. .uni-icon {
  50. line-height: 1.5;
  51. }
  52. .progress-cancel {
  53. margin-left: 40rpx;
  54. }
  55. .progress-control button{
  56. margin-top: 20rpx;
  57. }
  58. </style>