add a skeleton to the demo component
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user