| Server IP : 185.208.173.17 / Your IP : 87.236.161.98 Web Server : Microsoft-IIS/10.0 System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64 User : IUSR ( 0) PHP Version : 7.4.13 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/vue-lazy-hydration/src/ |
Upload File : |
import { makeHydrationBlocker } from './utils/hydration-blocker';
export function hydrateWhenIdle(componentOrFactory, { timeout = 2000 } = {}) {
return makeHydrationBlocker(componentOrFactory, {
beforeCreate() {
this.whenIdle = true;
this.idleTimeout = timeout;
},
});
}
export function hydrateWhenVisible(componentOrFactory, { observerOptions = undefined } = {}) {
return makeHydrationBlocker(componentOrFactory, {
beforeCreate() {
this.whenVisible = observerOptions || true;
},
});
}
export function hydrateNever(componentOrFactory) {
return makeHydrationBlocker(componentOrFactory, {
beforeCreate() {
this.never = true;
},
});
}
export function hydrateOnInteraction(componentOrFactory, { event = `focus` } = {}) {
const events = Array.isArray(event) ? event : [event];
return makeHydrationBlocker(componentOrFactory, {
beforeCreate() {
this.interactionEvents = events;
},
});
}
const Placeholder = {
render() {
return this.$slots.default;
},
};
export default makeHydrationBlocker(Placeholder, {
props: {
idleTimeout: {
default: 2000,
type: Number,
},
never: {
type: Boolean,
},
onInteraction: {
type: [Array, Boolean, String],
},
triggerHydration: {
default: false,
type: Boolean,
},
whenIdle: {
type: Boolean,
},
whenVisible: {
type: [Boolean, Object],
},
},
computed: {
interactionEvents() {
if (!this.onInteraction) return [];
if (this.onInteraction === true) return [`focus`];
return Array.isArray(this.onInteraction)
? this.onInteraction
: [this.onInteraction];
},
},
watch: {
triggerHydration: {
immediate: true,
handler(isTriggered) {
if (isTriggered) this.hydrate();
},
},
},
});