Vue version
3.4.31
Link to minimal reproduction
https://github.com/riz007/vuetify-3-6-13-issue
Steps to reproduce
-
Set Up the Project
Ensure your Vue 3 project is set up with Vuetify, Axios, and configured correctly with the provided Parent.vue, Child.vue, App.vue, and vite.config.js files.
-
Add Routing
Set up Vue Router to navigate to the Parent component. Ensure you can navigate to the Parent component using router.push('/parent').
-
Navigate to Parent Page
Use Vue Router to navigate to the Parent component by calling router.push('/parent').
-
Observe Loading State
- When navigating to the
Parent component, the isLoading state in the Parent component should be initially set to true.
- The
Child component should display a loading spinner (v-progress-circular) while isLoading is true.
-
Perform Data Fetch
- The
Parent component should make an HTTP request to fetch data using Axios when mounted.
- After the data is successfully fetched,
isLoading should be set to false.
-
Check Data Display
- Once
isLoading is false, the Child component should update to show the fetched data and display the message "Data loaded properly".
What is expected?
- Navigation: When navigating to the
Parent component using router.push, the Child component should display a loading spinner while data is being fetched.
- Loading State: The loading spinner should be visible while
isLoading is true.
- Data Display: After the data is fetched,
isLoading should be set to false, and the Child component should display the fetched data along with the message "Data loaded properly".
What is actually happening?
- Navigation Issue: The
Child component does not update the loading spinner correctly when navigating to the Parent component using router.push.
- Loading State: The loading spinner may not be displayed as expected when navigating to the
Parent component.
- Data Display: The
Child component might not show the fetched data correctly after isLoading is set to false, especially if the issue persists with router.push.
System Info
**Vuetify Version:** 3.6.13
**Vue Version:** 3.4.31
**Browsers:** Chrome 126.0.0.0
**OS:** Mac OS 10.15.7
Any additional comments?
- This behavior appeared only after bumping to Vuetify's latest version. Could be related to Vue 3's reactivity system but I am not sure.
- Wrapping the child component in a
<div> should not be necessary for reactivity to work correctly.
- Further investigation is required to understand the root cause.
Feedback from Vuetify team
I have previously raised this issue to the Vuetify core team and @KaelWD replied me this:
- It's a vue bug, you can reproduce this without vuetify by making the root of App.vue a
<Suspense>
Vue version
3.4.31
Link to minimal reproduction
https://github.com/riz007/vuetify-3-6-13-issue
Steps to reproduce
Set Up the Project
Ensure your Vue 3 project is set up with Vuetify, Axios, and configured correctly with the provided
Parent.vue,Child.vue,App.vue, andvite.config.jsfiles.Add Routing
Set up Vue Router to navigate to the
Parentcomponent. Ensure you can navigate to theParentcomponent usingrouter.push('/parent').Navigate to Parent Page
Use Vue Router to navigate to the
Parentcomponent by callingrouter.push('/parent').Observe Loading State
Parentcomponent, theisLoadingstate in theParentcomponent should be initially set totrue.Childcomponent should display a loading spinner (v-progress-circular) whileisLoadingistrue.Perform Data Fetch
Parentcomponent should make an HTTP request to fetch data using Axios when mounted.isLoadingshould be set tofalse.Check Data Display
isLoadingisfalse, theChildcomponent should update to show the fetched data and display the message "Data loaded properly".What is expected?
Parentcomponent usingrouter.push, theChildcomponent should display a loading spinner while data is being fetched.isLoadingistrue.isLoadingshould be set tofalse, and theChildcomponent should display the fetched data along with the message "Data loaded properly".What is actually happening?
Childcomponent does not update the loading spinner correctly when navigating to theParentcomponent usingrouter.push.Parentcomponent.Childcomponent might not show the fetched data correctly afterisLoadingis set tofalse, especially if the issue persists withrouter.push.System Info
Any additional comments?
<div>should not be necessary for reactivity to work correctly.Feedback from Vuetify team
I have previously raised this issue to the Vuetify core team and @KaelWD replied me this:
<Suspense>