mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-15 02:14:44 +00:00
42 lines
1.3 KiB
Markdown
42 lines
1.3 KiB
Markdown
# `<NuxtLoadingIndicator>`
|
|
|
|
The `<NuxtLoadingIndicator>` component displays a progress bar on page navigation.
|
|
|
|
## Examples
|
|
|
|
### Basic Usage
|
|
|
|
Add `<NuxtLoadingIndicator/>` in your `app.vue` or layouts.
|
|
|
|
```vue [app.vue]
|
|
<template>
|
|
<NuxtLayout>
|
|
<div>
|
|
<NuxtLoadingIndicator /> <!-- here -->
|
|
<NuxtPage />
|
|
</div>
|
|
</NuxtLayout>
|
|
</template>
|
|
```
|
|
|
|
:button-link[Open on StackBlitz]{href="https://stackblitz.com/github/nuxt/examples/tree/main/routing/pages?file=app.vue&terminal=dev" blank}
|
|
|
|
::alert{type=warning}
|
|
If you are changing layouts as well as page, the page transition you set here will not run. Instead, you should set a layout transition.
|
|
::
|
|
|
|
## Slots
|
|
|
|
You can pass custom HTML or components through the loading indicator's default slot.
|
|
|
|
## Props
|
|
|
|
- **color**: The color of the loading bar. It can be set to `false` to turn off explicit color styling.
|
|
- **height**: Height of the loading bar, in pixels (default `3`).
|
|
- **duration**: Duration of the loading bar, in milliseconds (default `2000`).
|
|
- **throttle**: Throttle the appearing and hiding, in milliseconds (default `200`).
|
|
|
|
::alert{type=info icon=🔎}
|
|
This component is completely optional. To achieve full customization, you can implement your own one based on [this file](https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/components/nuxt-loading-indicator.ts).
|
|
::
|