maoberlehner / vue-lazy-hydration

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

LazyHydrate not work for me #117

Open nekooee opened 2 years ago

nekooee commented 2 years ago

Hi, I used the LazyHydrate as follows but But in all cases, even "never" immediately runs the slideshow and the photos are displayed. What is the reason?

<template>
    <LazyHydrate when-idle>
        <header-slide-show :laravel-slides="images" :rtl="rtl"></header-slide-show>
    </LazyHydrate>
</template>

<script>
import LazyHydrate from 'vue-lazy-hydration';

export default {
    components: {
        LazyHydrate,
        headerSlideShow: () => import('./headerSlideShow'),
    },
    props: [
        'images', 'rtl'
    ],
    name: "loadHeaderSlideShow"
}
</script>
DavidGolodetsky commented 2 years ago

Maybe you're looking for lazy-loaded components because this package is for lazy-hydration. Meaning that your content is generated on server-side and shown immediately, but its "interactivity" is applied later.

nekooee commented 2 years ago

Maybe you're looking for lazy-loaded components because this package is for lazy-hydration. Meaning that your content is generated on server-side and shown immediately, but its "interactivity" is applied later.

Hi, Do you mean that this package is only for ssr?

DavidGolodetsky commented 2 years ago

Yup, it's from the package dscription:

This plugin will not work as advertised if you're not using it in combination with SSR. Although it should work with every pre-rendering approach (like Prerender SPA Plugin, Gridsome, ...) I've only tested it with Nuxt.js so far.