quasar
quasar copied to clipboard
Router view don't work well with virtual scroll
What happened?
Nested routes, use keep alive component with include, pages all using virtualScroll, when switch between it, error occurs.
RouterView2, Didn't use include
<router-view v-slot="{ Component }">
<keep-alive v-if="$route.meta.keepAlive">
<component :is="Component" :key="$route.path"></component>
</keep-alive>
<component :is="Component" v-if="!$route.meta.keepAlive"></component>
</router-view>
RouterView3, use include
<router-view v-slot="{ Component }">
<keep-alive v-if="$route.meta.keepAlive" :include="includeData">
<component :is="Component" :key="$route.path"></component>
</keep-alive>
<component :is="Component" v-if="!$route.meta.keepAlive"></component>
</router-view>
or just use router view
<router-view />
Error will be occur.
but if RouterView3 use the code as RouterView2, it works will.
the error text shows that, the rootRef is null, may be the QVirtualScroll component is unmounted, and rootRef value is deleted.
What did you expect to happen?
No Error.
Reproduction URL
https://github.com/JustYummy/keep-alive-virtual-scroll
How to reproduce?
- download code
- run
yarnornpm install - run
yarn devornpm run dev
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar)
Platforms/Browsers
Chrome, Safari, Electron
Quasar info output
No response
Relevant log output
No response
Additional context
No response
I have the same problem, updates about it?