vue-recyclerview
vue-recyclerview copied to clipboard
Errors beforeDestroy component
Testing the component I get errors when I go to another route before destroying the component.
Example:
Error in beforeDestroy hook: "TypeError: Cannot read property 'height' of undefined"
found in
---> <RecyclerView>
<Thread> at C:\wamp64\www\vue_mobile_material\src\components\thread\Thread.vue
<QLayout>
<Layout> at C:\wamp64\www\vue_mobile_material\src\components\Layout.vue
<App> at C:\wamp64\www\vue_mobile_material\src\App.vue
<Root>
@hazzo The problem here should have been fixed in 0.3.2, can you test it in 0.3.3?
Sorry I keep getting this error 😟
vue.runtime.esm.js?a427:430 [Vue warn]: Error in beforeDestroy hook: "TypeError: Cannot read property 'height' of undefined"
found in
---> <RecyclerView>
Can you describe the details of the scene? I tried switching RecyclerView and other views without experiencing problem.
I will investigate on my build. ;)
Hi again @hilongjw sorry could you upload your demo without compressing it? I need to reproduce the same effect in your demo that when you scroll up yo load more data. Now I'm loading everything at once at is not ideal 😟
Thanks!
@hazzo demo source code
Thanks!
The error beforeDestroy is solved. But before destroying the component execute the fetch action. That's not a good practice no? What is the need of it?
Another thing in your demo on the chat section, it'seems that when you scroll up it loads more elements. But if I replicate your demo with my data it loads all the data an scrolls to index. How did you achieve the effect that when scrolling up the scroll bar increases?
Sorry for to many requests 😕
@hazzo because my demo is using the local mock data, the problem is that all data will be loaded when scrolling to the end, and I'll fix it.
@hilongjw yes I am using "local data" too, I mean i get all the data before store it in vuex and in each chat I display the data. Bue it would be perfect that when you scroll to bottom avoid loading all data, only just when scroll up.
Hi @hilongjw did you have a chance look why fetch action is executed when destroying the component?
@hazzo got it thank you, I'll check it later.
any fix on not calling the fetch function before destroy
But before destroying the component execute the fetch action. That's not a good practice no? What is the need of it?