There is an "edit" button on my page which allows me to edit certain elements and either save or close without saving.
I would like to implement a loading bar that displays when the user clicks the "save" button, indicating that the data is being processed before showing the results.
Current functionality:
After clicking the "edit" button, editable data appears with options to "save" or "close" (which dismisses changes). Clicking "save" reloads the page with updated data and displays an "updated" message, or shows an error message if the update fails.
Desired functionality:
Upon clicking the "save" button after making edits, I want the page to show a loading bar for a few seconds (e.g. 5 seconds). If the request completes within that time, the loading bar disappears; otherwise, it continues until completion. The page then displays the updated data and the "updated" notification.
Below are snippets related to this feature:
Button setup:
Insert code snippet here
Edit function:
Insert code snippet here
For the progress bar, I am utilizing Vuetify's circular progress component.
<v-progress-circular
v-show="loading"
indeterminate
color="primary">
</v-progress-circular>
Struggling to determine where in the code to place this element for it to display correctly throughout the entire page. Placing it before or inside the buttons has not yielded the desired result.