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