add a skeleton to the demo component

This commit is contained in:
Hans Pagel
2021-01-20 23:00:26 +01:00
parent 578a8365c3
commit 9f2b09dd70
2 changed files with 16 additions and 4 deletions

View File

@@ -34,9 +34,12 @@
</a>
</div>
</template>
<div v-else class="demo__error">
<template v-else>
<div v-if="mainFile === false" class="demo__error">
Could not find a demo called {{ name }}.
</div>
<div v-else class="demo__skeleton" />
</template>
</div>
</template>
@@ -79,6 +82,7 @@ export default {
data() {
return {
loading: true,
files: [],
content: null,
currentIndex: 0,
@@ -94,7 +98,7 @@ export default {
.find(item => item.path.endsWith('index.vue') || item.path.endsWith('index.jsx'))
if (!file) {
return
return false
}
return require(`~/demos/${file.path}`).default

View File

@@ -90,4 +90,12 @@
color: $colorRed;
background-color: rgba($colorRed, 0.1);
}
&__skeleton {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
background-color: $colorWhite;
min-height: 20rem;
opacity: 0.1;
}
}