Broken FileUpload demo fixed

pull/5300/head
tugcekucukoglu 2024-02-16 15:37:21 +03:00
parent 6c16db6187
commit 1bb18ff0b6
1 changed files with 6 additions and 2 deletions

View File

@ -287,7 +287,11 @@ export default {
</template>
<script setup>
import { ref } from 'vue';
import { usePrimeVue } from 'primevue/config';
import { useToast } from "primevue/usetoast";
const $primevue = usePrimeVue();
const toast = useToast();
const totalSize = ref(0);
@ -325,7 +329,7 @@ const onTemplatedUpload = () => {
const formatSize = (bytes) => {
const k = 1024;
const dm = 3;
const sizes = this.$primevue.config.locale.fileSizeTypes;
const sizes = $primevue.config.locale.fileSizeTypes;
if (bytes === 0) {
return \`0 \${sizes[0]}\`;
@ -335,7 +339,7 @@ const formatSize = (bytes) => {
const formattedSize = parseFloat((bytes / Math.pow(k, i)).toFixed(dm));
return \`\${formattedSize} \${sizes[i]}\`;
},
};
<\/script>
`
}