Skip to content

Commit

Permalink
fix loading slot
Browse files Browse the repository at this point in the history
  • Loading branch information
Applelo committed May 2, 2024
1 parent ecc199b commit df3fcc7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Blottie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,19 @@ export default defineComponent({

expose({ anim, lottie, container })

const loadingSlot = () => {
if (slots.loading && pending.value)
return slots.loading()
return null
}

return (props: any) => {
return h(
props.containerTag,
{
ref: container,
},
() => pending.value ? slots.loading : undefined,
loadingSlot(),
)
}
},
Expand Down

0 comments on commit df3fcc7

Please sign in to comment.