|
@@ -6,4 +6,13 @@ const dateFormat = (value) => {
|
|
|
return formatDate(new Date(value), 'yyyy-MM-dd')
|
|
|
}
|
|
|
|
|
|
+const fileSize = (size) => {
|
|
|
+ size = Math.round(size / 1024)
|
|
|
+ if (size < 1024) return size + 'KB'
|
|
|
+ size = Math.round(size / 1024)
|
|
|
+ if (size < 1024) return size + 'MB'
|
|
|
+ return Math.round(size / 1024) + 'GB'
|
|
|
+}
|
|
|
+
|
|
|
Vue.filter('dateFormat', dateFormat)
|
|
|
+Vue.filter('fileSize', fileSize)
|