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

this.$refs.hydrate.hydrated not possible in version 2? #78

Open
simplenotezy opened this issue Nov 18, 2020 · 4 comments
Open

this.$refs.hydrate.hydrated not possible in version 2? #78

simplenotezy opened this issue Nov 18, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@simplenotezy
Copy link

In version one you could do:

<LazyHydrate ref="hydrate" when-visible>

And then in your javascript method do like so:

if (this.$refs.hydrate.hydrated) {

However, in version 2 that seems not to be possible anymore.

Am I missing something? I didn't find a changelog from version 1 -> 2 so not sure what has changed.

@maoberlehner
Copy link
Owner

Because I've completely rewritten v2, this is not possible anymore. I did not consider this a breaking change because your approach relies on implementation details that were not meant to be public and were not in the documentation.
I could add it back in. However, I'd prefer not to, to keep the code as simple as possible.

I also don't recommend doing this. The Vue model is props down, events up.

Would it be useful to you if <LazyHydrate> emits an event at the moment of hydration?

<LazyHydrate @hydrate="isHydrated = true">

@maoberlehner maoberlehner added the enhancement New feature or request label Nov 18, 2020
@simplenotezy
Copy link
Author

Yes, that would be very helpful @maoberlehner

@mattickx
Copy link

This certainly broke certain things in production.
The events suggestion would certainly fix this.
I'll keep an older version running for now.
+1

@mastercoding
Copy link

mastercoding commented Feb 7, 2021

I might be missing something, but this is an essential feature for lazy loading components to work for example (and to not have all of them "preloaded" on page load). And event would work fine, though.

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

No branches or pull requests

4 participants