mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
966 B
966 B
title | description | links | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
createIdleLoader | A utility function to customize delayed hydration based on network idle time. |
|
You can use this utility to customize the timeout of delayed hydration components based on network idle time.
Parameters
options
:{ timeout }
Example
If you would like to give a timeout of 5 seconds for the components:
<template>
<div>
<LazyIdleMyComponent :loader="createIdleLoader({timeout: 3000})"/>
</div>
<template>
::read-more{to="/docs/guide/directory-structure/components#delayed-hydration"} ::
::read-more{to="https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback"}
This is based on the requestIdleCallback
web API, and therefore only accepts the timeout prop, which should be a number.
::