mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +00:00
feat(nuxt): add default slot to <NuxtLoadingIndicator>
(#7128)
Co-authored-by: Alexander Lichter <github@lichter.io>
This commit is contained in:
parent
e94c3b3704
commit
75f4a54f7e
@ -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}
|
: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
|
## Props
|
||||||
|
|
||||||
- **color**: The color of the loading bar.
|
- **color**: The color of the loading bar.
|
||||||
|
@ -21,7 +21,7 @@ export default defineComponent({
|
|||||||
default: 'repeating-linear-gradient(to right,#00dc82 0%,#34cdfe 50%,#0047e1 100%)'
|
default: 'repeating-linear-gradient(to right,#00dc82 0%,#34cdfe 50%,#0047e1 100%)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup (props) {
|
setup (props, { slots }) {
|
||||||
const indicator = useLoadingIndicator({
|
const indicator = useLoadingIndicator({
|
||||||
duration: props.duration,
|
duration: props.duration,
|
||||||
throttle: props.throttle
|
throttle: props.throttle
|
||||||
@ -50,7 +50,7 @@ export default defineComponent({
|
|||||||
transition: 'width 0.1s, height 0.4s, opacity 0.4s',
|
transition: 'width 0.1s, height 0.4s, opacity 0.4s',
|
||||||
zIndex: 999999
|
zIndex: 999999
|
||||||
}
|
}
|
||||||
})
|
}, slots)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user