#browser hook?

4 messages · Page 1 of 1 (latest)

wooden rose
#

What would be the correct way to trigger a function once the page is loaded in the browser, after SSR?

I'm not sure I'm understanding well how ssr and onMounted work together.
onMounted triggers once the component is loaded. But if the page is rendered server side, then onMounted would ... be triggerred on the server side?

Is there a "pageLoadedInTheBrowser" hook?

I'm working on a component containing on scroll animations. I want to grab a list of elements with querySelectorAll (or is there a better way?) and apply them an observer with IntersectionObserver().

Thanks for your help!

eric

alpine marlin
#

or you can use nextTick inside onMounted hook maybe

wooden rose
#

thanks! I'e been checking the docs for days now and I've never seen this page. I think I'll find what I need in there. Thanks!!