Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors beforeDestroy component #10

Open
hazzo opened this issue Jun 4, 2017 · 14 comments
Open

Errors beforeDestroy component #10

hazzo opened this issue Jun 4, 2017 · 14 comments

Comments

@hazzo
Copy link

hazzo commented Jun 4, 2017

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>
@hilongjw
Copy link
Owner

hilongjw commented Jun 5, 2017

@hazzo The problem here should have been fixed in 0.3.2, can you test it in 0.3.3?

@hazzo
Copy link
Author

hazzo commented Jun 5, 2017

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>

@hilongjw
Copy link
Owner

hilongjw commented Jun 5, 2017

Can you describe the details of the scene? I tried switching RecyclerView and other views without experiencing problem.

@hazzo
Copy link
Author

hazzo commented Jun 5, 2017

I will investigate on my build. ;)

@hazzo
Copy link
Author

hazzo commented Jun 6, 2017

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!

@hilongjw
Copy link
Owner

hilongjw commented Jun 6, 2017

@hazzo demo source code

@hazzo
Copy link
Author

hazzo commented Jun 6, 2017

Thanks!

@hazzo
Copy link
Author

hazzo commented Jun 7, 2017

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?

@hazzo
Copy link
Author

hazzo commented Jun 7, 2017

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 😕

@hilongjw
Copy link
Owner

hilongjw commented Jun 7, 2017

@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.

@hazzo
Copy link
Author

hazzo commented Jun 7, 2017

@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.

@hazzo
Copy link
Author

hazzo commented Jun 8, 2017

Hi @hilongjw did you have a chance look why fetch action is executed when destroying the component?

@hilongjw
Copy link
Owner

hilongjw commented Jun 8, 2017

@hazzo got it thank you, I'll check it later.

@rahul-dutt-sharma
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants