mx-progress.vue 544 B

123456789101112131415161718192021
  1. <template>
  2. <view class="progress-bar flex rounded" :style="{backgroundColor: bgColor}">
  3. <view class="progress-bar-thumb h-full rounded" :style="{flex: progress, backgroundColor: activeColor}"></view>
  4. </view>
  5. </template>
  6. <script setup>
  7. import {createPropDefine} from "@/utils";
  8. defineProps({
  9. progress: createPropDefine(0, Number),
  10. bgColor: createPropDefine('#CBFCEB'),
  11. activeColor: createPropDefine('#0FD296')
  12. })
  13. </script>
  14. <style scoped lang="scss">
  15. .progress-bar-thumb {
  16. transition: flex 0.5s ease;
  17. }
  18. </style>