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

View File

@@ -90,4 +90,12 @@
color: $colorRed; color: $colorRed;
background-color: rgba($colorRed, 0.1); 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;
}
} }