2019-08-09 20:20:08 +00:00
|
|
|
<template>
|
|
|
|
<span class="preview-size">({{ previewSize }})</span>
|
|
|
|
</template>
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import {defineComponent} from "vue";
|
2019-12-16 11:26:10 +00:00
|
|
|
import friendlysize from "../js/helpers/friendlysize";
|
2019-08-09 20:20:08 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
export default defineComponent({
|
2019-08-09 20:20:08 +00:00
|
|
|
name: "LinkPreviewFileSize",
|
|
|
|
props: {
|
2022-06-19 00:25:21 +00:00
|
|
|
size: {type: Number, required: true},
|
2019-08-09 20:20:08 +00:00
|
|
|
},
|
2022-06-19 00:25:21 +00:00
|
|
|
setup(props) {
|
|
|
|
const previewSize = friendlysize(props.size);
|
|
|
|
|
|
|
|
return {
|
|
|
|
previewSize,
|
|
|
|
};
|
2019-08-09 20:20:08 +00:00
|
|
|
},
|
2022-06-19 00:25:21 +00:00
|
|
|
});
|
2019-08-09 20:20:08 +00:00
|
|
|
</script>
|