FileProcess.vue 507 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <span class="error-color">{{ process }}</span>
  3. </template>
  4. <script>
  5. import { sizestrWithUnit } from '@/utils/utils'
  6. export default {
  7. name: 'FileProcess',
  8. props: {
  9. size: {
  10. type: [String, Number],
  11. required: true,
  12. },
  13. },
  14. data () {
  15. return {}
  16. },
  17. computed: {
  18. process () {
  19. let size = sizestrWithUnit(this.size, 'B', 1024)
  20. if (!parseInt(size)) {
  21. size = '0 MB'
  22. }
  23. return this.$t('compute.text_639', [size])
  24. },
  25. },
  26. }
  27. </script>