I Want Make a Progress Bar For My Live Wire Function Progress. When i Use wire:loading i can just show spinning icon o another text like "uploading ..." , now how can i make progress bar for that ?
I was found it in live wire documentation but not work for show function execution :
<script>
document.addEventListener('livewire:load',() => {
let progressSection = document.querySelector('#progressbar'),
progressBar = progressSection.querySelector('#progress-fill');
document.addEventListener('livewire-upload-start' , () => {});
document.addEventListener('livewire-upload-finish' , () => {});
document.addEventListener('livewire-upload-error' , () => {});
document.addEventListener('livewire-upload-progress' , (event) => {
progressSection.style.display = "block";
console.log(`${event.detail.progress}%`);
progressBar.style.width = `${event.detail.progress}%`;
});
});
</script>
in the live wire component i was upload file to my ftp server and i want show uploading percentage of file in front end , when i run the upload method.
thanks very much