测试升级为vue3

This commit is contained in:
暮光:城中城
2023-01-07 00:34:05 +08:00
parent e45b63077a
commit 78044ce920
53 changed files with 33535 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
export default {
computeFileSize(fileSize) {
if (!fileSize) {
return '-'
}
let size = ''
if (fileSize < 0.1 * 1024) {
size = fileSize.toFixed(2) + 'B'
} else if (fileSize < 0.1 * 1024 * 1024) {
size = (fileSize / 1024).toFixed(2) + 'KB'
} else if (fileSize < 0.1 * 1024 * 1024 * 1024) {
size = (fileSize / (1024 * 1024)).toFixed(2) + 'MB'
} else {
size = (fileSize / (1024 * 1024 * 1024)).toFixed(2) + 'GB'
}
let sizeStr = size + ''
let index = sizeStr.indexOf('.')
let dou = sizeStr.substr(index + 1, 2)
if (dou == '00') {
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2)
}
return size
},
}