Skip to content

Commit

Permalink
Merge pull request #67 from SpeciesFileGroup/development
Browse files Browse the repository at this point in the history
Fix Skeleton component
  • Loading branch information
José Luis Pereira authored and GitHub committed May 8, 2023
2 parents e3c8b54 + c69e0cf commit 9c5088c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/components/VSkeleton.global.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<slot />
<span
v-if="isEmpty"
v-if="isLoading"
:class="class"
>
<span
Expand All @@ -15,7 +15,7 @@
</template>

<script setup>
import { useAttrs, useSlots, computed } from 'vue'
import { useSlots, computed } from 'vue'
const props = defineProps({
class: {
Expand All @@ -30,9 +30,8 @@ const props = defineProps({
})
const slots = useSlots()
const attrs = useAttrs()
const isEmpty = computed(() => {
const isLoading = computed(() => {
const children = slots.default?.()
return isEmptyVNode(children)
Expand All @@ -44,6 +43,6 @@ function isEmptyVNode(children) {
const [firstNode] = children
let str = firstNode.children
return firstNode.el || str
return firstNode.el !== null || str !== null
}
</script>
3 changes: 1 addition & 2 deletions src/modules/otus/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@
import { ref, watch, onServerPrefetch, computed, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useOtuStore } from '../store/store'
import { useHead } from 'unhead'
import Breadcrumb from '../components/Breadcrumb/Breadcrumb.vue'
import TaxaInfo from '../components/TaxaInfo.vue'
import { useHead, createHead } from 'unhead'
import VSkeletonGlobal from '@/components/VSkeleton.global.vue'
//import useChildrenRoutes from '../composables/useChildrenRoutes'
Expand Down

0 comments on commit 9c5088c

Please sign in to comment.