feat: 完成网站前端的基本建设
- 网站内容展示:首页, 产品页, 解决方案, 联系信息等 - 网站跳转逻辑:通过Vue-Router实现路由跳转 - 后端通信: 通过Nuxt Strapi与后端Strapi服务进行通信
This commit is contained in:
12
app/utils/file.ts
Normal file
12
app/utils/file.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export function formatFileSize(sizeInKB: number): string {
|
||||
if (sizeInKB < 1024) {
|
||||
return `${sizeInKB.toFixed(2)} KB`;
|
||||
} else {
|
||||
const sizeInMB = sizeInKB / 1024;
|
||||
return `${sizeInMB.toFixed(2)} MB`;
|
||||
}
|
||||
}
|
||||
|
||||
export function formatFileExtension(ext: string): string {
|
||||
return ext.startsWith('.') ? ext.slice(1).toUpperCase() : ext.toUpperCase();
|
||||
}
|
||||
Reference in New Issue
Block a user