|
|
@@ -21,9 +21,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
- import Vue from 'vue';
|
|
|
- import Component from 'vue-class-component';
|
|
|
- import { Prop } from 'vue-property-decorator';
|
|
|
+ import { defineComponent } from 'vue';
|
|
|
|
|
|
const UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'];
|
|
|
|
|
|
@@ -42,15 +40,20 @@
|
|
|
return `${unitValue} ${UNITS[unitIndex]}`;
|
|
|
};
|
|
|
|
|
|
- @Component
|
|
|
- export default class HumanByteSize extends Vue {
|
|
|
- @Prop({ required: false })
|
|
|
- value?: number;
|
|
|
-
|
|
|
- get humanSize(): string {
|
|
|
- return humanSize(this.value);
|
|
|
+ export default defineComponent({
|
|
|
+ props: {
|
|
|
+ value: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ humanSize(): string {
|
|
|
+ return humanSize(this.value);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|