maoberlehner / vue-lazy-hydration

Lazy Hydration of Server-Side Rendered Vue.js Components
MIT License
1.18k stars 52 forks source link

fix: do not hydrate single root elements #51

Open simllll opened 4 years ago

simllll commented 4 years ago

I have a component with several v-if v-else-ifs and some other logic in there, but at the end it only exposes one single root element. due to the check of childElementCount this was immediately hydrated, even though it shouldn't. Checking for nodeType seems more reliable and is fully supported in all browsers.

simllll commented 3 years ago

if it achieves the same, it should be fine. I can't really say anmore, but I waas playing around with nodeType too, but I didn't get it to work as expected

@weotch can you run my tests against your PR? do they work?