Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt): add default slot to <NuxtLoadingIndicator> #7128

Merged
merged 6 commits into from Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/content/3.api/2.components/4.nuxt-loading-indicator.md
Expand Up @@ -19,6 +19,10 @@ Add `<NuxtLoadingIndicator/>` in your `app.vue` or layouts.

:button-link[Open on StackBlitz]{href="https://stackblitz.com/github/nuxt/framework/tree/main/examples/routing/pages?terminal=dev&file=/app.vue" blank}

## Slots

You can pass custom HTML or components through the loading indicator's default slot.

## Props

- **color**: The color of the loading bar.
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/components/nuxt-loading-indicator.ts
Expand Up @@ -21,7 +21,7 @@ export default defineComponent({
default: 'repeating-linear-gradient(to right,#00dc82 0%,#34cdfe 50%,#0047e1 100%)'
}
},
setup (props) {
setup (props, { slots }) {
const indicator = useLoadingIndicator({
duration: props.duration,
throttle: props.throttle
Expand Down Expand Up @@ -50,7 +50,7 @@ export default defineComponent({
transition: 'width 0.1s, height 0.4s, opacity 0.4s',
zIndex: 999999
}
})
}, slots)
}
})

Expand Down