[ui] Vue 3 - Migrated HumanByteSize component
</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'];
return `${unitValue} ${UNITS[unitIndex]}`;
};
- @Component
- export default class HumanByteSize extends Vue {
- @Prop({ required: false })
- value?: number;
+ export default defineComponent({
+ props: {
+ value: {
+ type: Number,
+ default: 0
+ }
+ },
- get humanSize(): string {
+ computed: {
+ humanSize(): string {
return humanSize(this.value);
}
}
+ });
</script>
<style lang="scss" scoped></style>
