diff --git a/components/lib/fileupload/FileContent.vue b/components/lib/fileupload/FileContent.vue index a6df717de..ce4f04895 100644 --- a/components/lib/fileupload/FileContent.vue +++ b/components/lib/fileupload/FileContent.vue @@ -54,7 +54,7 @@ export default { formatSize(bytes) { const k = 1024; const dm = 3; - const sizes = this.$primevue.config.locale.fileSizeTypes; + const sizes = this.$primevue.config.locale?.fileSizeTypes; if (bytes === 0) { return `0 ${sizes[0]}`; diff --git a/components/lib/fileupload/FileUpload.vue b/components/lib/fileupload/FileUpload.vue index 25f232aa9..1da081309 100755 --- a/components/lib/fileupload/FileUpload.vue +++ b/components/lib/fileupload/FileUpload.vue @@ -328,7 +328,7 @@ export default { formatSize(bytes) { const k = 1024; const dm = 3; - const sizes = this.$primevue.config.locale.fileSizeTypes; + const sizes = this.$primevue.config.locale?.fileSizeTypes; if (bytes === 0) { return `0 ${sizes[0]}`; diff --git a/doc/fileupload/TemplateDoc.vue b/doc/fileupload/TemplateDoc.vue index 3637a38e6..a0819e921 100644 --- a/doc/fileupload/TemplateDoc.vue +++ b/doc/fileupload/TemplateDoc.vue @@ -317,7 +317,7 @@ const onTemplatedUpload = () => { toast.add({ severity: "info", summary: "Success", detail: "File Uploaded", life: 3000 }); }; -formatSize(bytes) { +const formatSize = (bytes) => { const k = 1024; const dm = 3; const sizes = this.$primevue.config.locale.fileSizeTypes;