Skip to content

Commit

Permalink
fix(VSkeletonLoader): don't call the default slot if not used
Browse files Browse the repository at this point in the history
fixes #10201 with v-slot
  • Loading branch information
KaelWD committed Jan 13, 2020
1 parent ca1a8ca commit e0f3f08
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ export default mixins(
}
},
isLoading (): boolean {
return Boolean(
!getSlot(this) ||
this.loading
)
return !('default' in this.$scopedSlots) || this.loading
},
rootTypes (): Record<string, string> {
return {
Expand Down Expand Up @@ -143,9 +140,8 @@ export default mixins(
},
genSkeleton () {
const children = []
const slot = getSlot(this)

if (!this.isLoading) children.push(slot)
if (!this.isLoading) children.push(getSlot(this))
else children.push(this.genStructure())

/* istanbul ignore else */
Expand Down

0 comments on commit e0f3f08

Please sign in to comment.